Solr Search on XWiki in Action.
Solr component indexes all the pages inside Sandbox. To keep it simple, I have indexed pages in english, french and spanish.
I have used the below setup to explain the working of solr component.
Pages:
Few more pages with “test” in the body but not in page title. Other random pages with l'arbre (the tree) to show french text is being parsed well. ( http://jira.xwiki.org/browse/XWIKI-6226 )
Fields:
1. The apostrophe ( ' ) is now considered as a separator (http://jira.xwiki.org/browse/XWIKI-6226
Searching for arbre and l’arbre returns the same set of results because l’ is treated as the stop word.
Searching with l’arbre
2. Customizing the relevancy score using boost index.
Test Page1 - 1.36 -> Has ‘Test’ in title_end and ft_en.
Test Page4- 1.33 -> Has ‘Test’ in title_end only
Test Page2 - 1.33 -> Has ‘Test’ in title_end only
Test Page3 - 1.33 -> Has ‘Test’ in title_end only
Tree of gods - 1.09 -> Has ‘Test’ in ft_en, very small document.
WebHome - 0.32 -> Has ‘Test’ in ft_en, this is a large document. hence according to tf*idf, the term frequency is normalized and comes out to be a small value. Therefore a lower score all together.
score by EDISMAX handler in brackets.
Tree of gods - 1.09 -> Has ‘Test’ in ft_en, very small document. Score reduced for title_en fields, as relative weight reduced.
English field has more weight.
Note: In the 3rd and 4th screen shot, the title is in english for both french and english pages but the content is in the respective languages.