Apologies if I am posting a duplicated question, if so please point me to original question.
I am a solr novice and trying to achieve ordered word name search using solr.I am expecting following response from solr
Name Search Term Result
Thomas Alva Edison Thomas Match
Thomas Alva Edison Alva Match
Thomas Alva Edison Edison Match
Thomas Alva Edison Thomas Edison Match
Thomas Alva Edison Thomas Alva Match
Thomas Alva Edison Alva Edison Match
Thomas Alva Edison Thomas Alva Edison Match
Thomas Alva Edison homas No Match
Thomas Alva Edison Edison Thomas No Match
Thomas Alva Edison homas edison No Match
Thomas Alva Edison homas dison No Match
I am generating queries using MethodName using spring data solr. Please help me how I should form my schema to index this data and what filters I should use ?
Also guide me how to form the queries using methodName using spring data solr from appropriate result.
Your
schema.xml
may be the one delivered withsolr
because there is already a field namedname
(tokenized and indexed) in there as follows:so all you need to do is to create a document on that index:
You probably have a java class representing your document structure more or less as follows:
and a repository as follows:
in order to have a search based on name you can declare the following method:
As the field is tokenized, it will search for the provided parameter within a token from that field. This will lead to the results you are expecting.