You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by J Mohamed Zahoor <za...@indix.com> on 2013/04/02 14:56:47 UTC

Query using function query result

Hi


i want to query documents which match a certain dynamic criteria.
like, How do i get all documents, where sub(field1,field2) < 0 ?

i tried _val_: sub(field1,field2) and used fq:[_val_:[0 TO *]
But it doesnt work.

./Zahoor

Re: Query using function query result

Posted by Chris Hostetter <ho...@fucit.org>.
: i want to query documents which match a certain dynamic criteria.
: like, How do i get all documents, where sub(field1,field2) < 0 ?
: 
: i tried _val_: sub(field1,field2) and used fq:[_val_:[0 TO *]

take a look at the frange QParser...

https://lucene.apache.org/solr/4_3_0/solr-core/org/apache/solr/search/FunctionRangeQParserPlugin.html

  fq={!frange l=0}sub(field1,field2)

I've updated the wiki to draw more attention to this usage...

https://wiki.apache.org/solr/FunctionQuery#Using_FunctionQuery


-Hoss