Pregunta

I'm about to add a feature to my project that will allow users to place a Solr query like...

immigration law citations:50

...which would yield legal documents containing 'immigration' AND 'law' AND a citation count greater than 50.

Internally, I can parse out strings like citations:50 and convert them to citations:[50 TO *], but post-processing the query parser is best avoided if possible.

Seems like there ought to be a way in the schema to say, "When people search on this field, always look for the value and find anything greater."

Anything like that or ideas for how to do this elegantly? I hate query postprocessing in my app. Nasty stuff.

¿Fue útil?

Solución

In order not to depend on a particular QueryParser implementation, you could create a custom field type by overriding the getFieldQuery method of the field type you are currently using to return a range query instead of a term query.

See the default implementation for getFieldQuery.

But I still find it a little misleading to have : mean .

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top