Recently we had a bug in Knowbuddy app where search was not able to find anything based on sub keywords or sub text.
Example - Lets say we have an article that has keyword "dedicated" in subject or body or in tags. Now if we try to search using keywords say | cat | cate | ted | dedi | dicat | dedi | then outcome was zero search results.
This issue was due to the way indexing was done along with missing query configuration in Solr . We fixed the indexing and seaching conf in solr/conf/schema.xml file. We added/edited following code snippet in solr/conf/schema.xml file.
This configuration snippets helps solr index the tokens by gram size of 1 to 20 and do partial word searching. Check this article to know more about these index tokens and NGrams -
"Use of NGram Filter factory for wild card search" - http://abhijitbashetti.blogspot.in/2011/09/solr-use-of-ngram-filter-factory-for.html
Kavita helped me to fix this issue. We also used "Solr Admin page" to test the queries and results.
Solr Admin page URL - http://localhost:8982/solr/admin/
(Check the port on which Solr is running on your local by issuing this command "ps -ef | grep solr" and accordingly use this port in the URL)
Refer attached screenshot. This is the way we queried the solr indexer to test search results based on partial text / keywords. So the solr admin really proved to be very useful for this index and search testing on local.
This link helped us with the query language syntax used in Solr Admin page - http://www.solrtutorial.com/solr-query-syntax.html
Subscribe to Engineering At Kiprosh
Get the latest posts delivered right to your inbox