1

I am using solr-3.6. I have a list of searchable fields in my Solr-Index like,

  • name
  • email
  • city
  • state
  • country

All these fields are of the same type "String" and are indexed and stored. All the 5 fields are copied to the copy field named "text" and searched on. No tokenizers are used during indexing and querying.

Consider that I search the Index for value "John"(searched as "John*" to get wildcard search), which matches in 5 documents as given below:

< doc>
< name>Johnson< /name>
< other fields> .... < /other fields>
< /doc>

< doc>
< email>John043@xyz.com< /email>
< other fields> .... < /other fields>
< /doc>

< doc>
< city>Johnyville< /city>
< other fields> .... < /other fields>
< /doc>

< doc>
< state>Johnford< /state>
< other fields> .... < /other fields>
< /doc>

< doc>
< country>Johnland< /country>
< other fields> .... < /other fields>
< /doc>

I want this result to be sorted based on the value it matches as following:

Johnford, Johnland, Johnson, Johnyville, and John043@xyz.com

I cannot sort based on copyfield "text" because it is a multivalued field.
Is this possible to achieve this type of sorting on multiple fields which match our search query?

Please comment on the feasibility of doing this and means to do it. Thanks in advance!

4

0 回答 0