Expand my Community achievements bar.

SOLVED

OOB Lucene Search component- How to exclude a component on page from search

Avatar

Level 4

Hi everyone,

 

We are using OOB lucene search component. Currently the search is searching the text in all the components in a page and if the search term matches it returns that page. Because of this for example if we search for word "blog" then our "profile page" appears in search results because "blog" word is present in LEFT RAIL navigation on "profile page".

 

To fix this we added below rule to ignore that component (LEFT RAIL)

<index-rule nodeType="nt:unstructured">

<property isRegexp="true" nodeScopeIndex="false">/jcr:content/configurablemenu/title*</property>

</index-rule>

 

But now after adding this rule lucene is not searching other components like "Rich Text" and "Text" Component (any other component which has text property)

 

Please let me know if you have encountered similar issue. Thanks in advance.

1 Accepted Solution

Avatar

Correct answer by
Level 10

You are using regular expression & hence applies to all. Avoiding it should help. More details at http://wiki.apache.org/jackrabbit/IndexingConfiguration

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

You are using regular expression & hence applies to all. Avoiding it should help. More details at http://wiki.apache.org/jackrabbit/IndexingConfiguration

Avatar

Level 4

Thanks for you reply. Let me try it. By any chance have you worked on similar requirement before.