「簡單」搜尋實作是Adobe Summit實驗室AEM Search Demystified中的資料。 本頁包含本實驗的資料。 有關實驗室的指導教程,請查看本頁的「演示」部分中的實驗室工作簿。
以下章節連結假設初 始 套件已安裝在AEM作者上,位於http://localhost:4502
實驗室討論的更正和澄清以及與會者對後續問題的回答。
如何停止重新索引?
可通過AEM Web Console > JMX提供的IndexStats MBean停止重新索引
abortAndPause()
以中止重新索引。 這會鎖定索引以進一步重新索引,直到叫用resume()
為止。resume()
將重新啟動索引過程。Oak索引如何支援多個租戶?
Oak支援將索引貫穿內容樹狀結構,且這些索引只會在該子樹狀結構內建立索引。 例如,/content/site-a/oak:index/cqPageLucene
僅可在/content/site-a
下建立為內容索引。
等效方法是在/oak:index
下的索引上使用includePaths
和queryPaths
屬性。 例如:
/oak:index/siteAcqPageLucene@includePaths=/content/site-a
/oak:index/siteAcqPageLucene@queryPaths=/content/site-a
此方法的考量如下:
/oak:index/cqPageLucene
)也將為資料建立索引,從而導致重複獲取和磁碟使用成本。所有可用分析器的清單在哪裡?
Oak會公開一組lucene提供的分析器設定元素,以用於AEM。
如何在同一查詢中搜尋頁面和資產?
AEM 6.3的新功能,是在同一個提供的查詢中查詢多個節點類型的功能。 下列QueryBuilder查詢。 請注意,每個"sub-query"都可解析為其自己的索引,因此在此範例中,cq:Page
子查詢解析為/oak:index/cqPageLucene
,而dam:Asset
子查詢解析為/oak:index/damAssetLucene
。
group.p.or=true
group.1_group.type=cq:Page
# add all page restrictions to this group
group.2_group.type=dam:Asset
# add all asset restrictions to this group
導致以下查詢和查詢計畫:
QUERY:(//element(*, cq:Page) | //element(*, dam:Asset))
PLAN: [cq:Page] as [a] /* lucene:cqPageLucene(/oak:index/cqPageLucene) *:* */ union [dam:Asset] as [a] /* lucene:damAssetLucene(/oak:index/damAssetLucene) *:* */
透過QueryBuilder Debugger和AEM Chrome外掛程式探索查詢和結果。
如何在同一查詢中搜尋多個路徑?
AEM 6.3的新功能,是可在相同提供的查詢中跨多個路徑查詢。 下列QueryBuilder查詢。 請注意,每個「子查詢」都可解析為自己的索引。
group.p.or=true
group.1_group.type=cq:Page
group.1_group.path=/content/docs/en/6-2
# add all page restrictions to this group
group.2_group.type=cq:Page
group.2_group.path=/content/docs/en/6-3
# add all asset restrictions to this group
生成以下查詢和查詢計畫
QUERY: (/jcr:root/content/docs/en/_x0036_-2//element(*, cq:Page) | /jcr:root/content/docs/en/_x0036_-3//element(*, cq:Page))
PLAN: [cq:Page] as [a] /* traverse "/content/docs/en/6-2//*" where isdescendantnode([a], [/content/docs/en/6-2]) */ union [cq:Page] as [a] /* traverse "/content/docs/en/6-3//*" where isdescendantnode([a], [/content/docs/en/6-3]) */
透過QueryBuilder Debugger和AEM Chrome外掛程式探索查詢和結果。