Highlight on non-text fields and/or field-match list

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Highlight on non-text fields and/or field-match list

John Nagro
I've done some searching through the archives and google, as well as some tinkering on my own with no avail. My goal is to get a list of the fields that matched a particular query. At first, I thought highlighting was the solution however its slowly becoming clear that it doesn't do what I need it to. For example, if I have a field in a document such as "username" which is a string that I'll do wild-card searches on, Solr will return document matches but no highlight data for that field. The end-goal is to know which fields matched, at this point I don't need the highlighted fragment itself. Is there any way to generate a list of matching fields? Something easier than trying to parse debug information?

Thanks!

Reply | Threaded
Open this post in threaded view
|

Re: Highlight on non-text fields and/or field-match list

hossman

: to. For example, if I have a field in a document such as "username" which is
: a string that I'll do wild-card searches on, Solr will return document
: matches but no highlight data for that field. The end-goal is to know which

FYI: this is a known bug that results from a "safety" net in the
SolrQueryParser...

        https://issues.apache.org/jira/browse/SOLR-195

...wildcards work in the trunk, and there is a workarround for
prefix queries mentioned in the issue (you trick the queryparser into
doing a wildcard query).

In general "fields" don't match queries, "documents" match queries ...
highlighting can show you places "terms" and "phrases" appear in
documents, but that doesn't garuntee that the "terms" highlighted are the
reason the document matched the query.  the explain info is the only thing
that can do that.




-Hoss