AW: Looking for docs that have certain fields empty (an/or not set)
Thanks for the input. In fact, we are using this very query as a Solr queryFilter (i.e. qf). Is there a specific (Lucene query) syntax to formulate (force the usage of) such a FieldValueFilter? -Ursprüngliche Nachricht- Von: Ahmet Arslan [mailto:iori...@yahoo.com.INVALID] Gesendet: Mittwoch, 7. Januar 2015 17:41 An: java-user@lucene.apache.org Betreff: Re: Looking for docs that have certain fields empty (an/or not set) Hi Clemens, Since you are a lucene user, you might be interested in Uwe's response on a similar topic : http://find.searchhub.org/document/abb73b45a48cb89e Ahmet On Wednesday, January 7, 2015 6:30 PM, Erick Erickson erickerick...@gmail.com wrote: Should be, but it's a bit confusing because the query syntax is not pure boolean, so there's no set to take away the docs with entries in field 1, you need the match all docs bit, i.e. *:* -field1:[* TO *] (That's asterisk:asterisk -field1:[* TO *] in case the silly list interprets the asterisks as markup) There's some special magic in filter query processing to handle this case, but not in the main query parser. Best, Erick On Wed, Jan 7, 2015 at 8:14 AM, Clemens Wyss DEV clemens...@mysign.ch wrote: Say I wanted to find documents which have no content in field1 (or dosuments that have no field 'field1'), wouldn't that be the following query? -field1:[* TO *] Thanks for you help Clemens - To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org - To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org - To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org
RE: Looking for docs that have certain fields empty (an/or not set)
Hi, In Lucene you don't need to use a query parser for that, especially because range Queries is suboptimal and slow: There is already a very fast query/filter available. Ahmet Arslan already mentioned that, we had the same discussion a few weeks ago: http://find.searchhub.org/document/abb73b45a48cb89e Uwe - Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: u...@thetaphi.de -Original Message- From: Jack Krupansky [mailto:jack.krupan...@gmail.com] Sent: Wednesday, January 07, 2015 10:17 PM To: java-user@lucene.apache.org Subject: Re: Looking for docs that have certain fields empty (an/or not set) Oops... I take that back! After I clicked Send I realized that this is the Lucene list - what I said is true for Solr queries, but that is because Solr added a hack to do things properly, but the Lucene query parser doesn't have that hack, so Erick is correct. -- Jack Krupansky On Wed, Jan 7, 2015 at 4:15 PM, Jack Krupansky jack.krupan...@gmail.com wrote: The pure negative query should work fine as a top level query - it's just when nested as a sub-query within parentheses that it misbehaves. -- Jack Krupansky On Wed, Jan 7, 2015 at 11:30 AM, Erick Erickson erickerick...@gmail.com wrote: Should be, but it's a bit confusing because the query syntax is not pure boolean, so there's no set to take away the docs with entries in field 1, you need the match all docs bit, i.e. *:* -field1:[* TO *] (That's asterisk:asterisk -field1:[* TO *] in case the silly list interprets the asterisks as markup) There's some special magic in filter query processing to handle this case, but not in the main query parser. Best, Erick On Wed, Jan 7, 2015 at 8:14 AM, Clemens Wyss DEV clemens...@mysign.ch wrote: Say I wanted to find documents which have no content in field1 (or dosuments that have no field 'field1'), wouldn't that be the following query? -field1:[* TO *] Thanks for you help Clemens --- -- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org - To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org - To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org
RE: Looking for docs that have certain fields empty (an/or not set)
: In Lucene you don't need to use a query parser for that, especially : because range Queries is suboptimal and slow: There is already a very : fast query/filter available. Ahmet Arslan already mentioned that, we had : the same discussion a few weeks ago: : http://find.searchhub.org/document/abb73b45a48cb89e Thanks for reminding me Uwe, been meaning to file that as an improvement... https://issues.apache.org/jira/browse/SOLR-6927 -Hoss http://www.lucidworks.com/ - To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org
Re: Looking for docs that have certain fields empty (an/or not set)
Oops... I take that back! After I clicked Send I realized that this is the Lucene list - what I said is true for Solr queries, but that is because Solr added a hack to do things properly, but the Lucene query parser doesn't have that hack, so Erick is correct. -- Jack Krupansky On Wed, Jan 7, 2015 at 4:15 PM, Jack Krupansky jack.krupan...@gmail.com wrote: The pure negative query should work fine as a top level query - it's just when nested as a sub-query within parentheses that it misbehaves. -- Jack Krupansky On Wed, Jan 7, 2015 at 11:30 AM, Erick Erickson erickerick...@gmail.com wrote: Should be, but it's a bit confusing because the query syntax is not pure boolean, so there's no set to take away the docs with entries in field 1, you need the match all docs bit, i.e. *:* -field1:[* TO *] (That's asterisk:asterisk -field1:[* TO *] in case the silly list interprets the asterisks as markup) There's some special magic in filter query processing to handle this case, but not in the main query parser. Best, Erick On Wed, Jan 7, 2015 at 8:14 AM, Clemens Wyss DEV clemens...@mysign.ch wrote: Say I wanted to find documents which have no content in field1 (or dosuments that have no field 'field1'), wouldn't that be the following query? -field1:[* TO *] Thanks for you help Clemens - To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org - To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org
Looking for docs that have certain fields empty (an/or not set)
Say I wanted to find documents which have no content in field1 (or dosuments that have no field 'field1'), wouldn't that be the following query? -field1:[* TO *] Thanks for you help Clemens - To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org
Re: Looking for docs that have certain fields empty (an/or not set)
Should be, but it's a bit confusing because the query syntax is not pure boolean, so there's no set to take away the docs with entries in field 1, you need the match all docs bit, i.e. *:* -field1:[* TO *] (That's asterisk:asterisk -field1:[* TO *] in case the silly list interprets the asterisks as markup) There's some special magic in filter query processing to handle this case, but not in the main query parser. Best, Erick On Wed, Jan 7, 2015 at 8:14 AM, Clemens Wyss DEV clemens...@mysign.ch wrote: Say I wanted to find documents which have no content in field1 (or dosuments that have no field 'field1'), wouldn't that be the following query? -field1:[* TO *] Thanks for you help Clemens - To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org - To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org
AW: Looking for docs that have certain fields empty (an/or not set)
Thx! -Ursprüngliche Nachricht- Von: Erick Erickson [mailto:erickerick...@gmail.com] Gesendet: Mittwoch, 7. Januar 2015 17:31 An: java-user Betreff: Re: Looking for docs that have certain fields empty (an/or not set) Should be, but it's a bit confusing because the query syntax is not pure boolean, so there's no set to take away the docs with entries in field 1, you need the match all docs bit, i.e. *:* -field1:[* TO *] (That's asterisk:asterisk -field1:[* TO *] in case the silly list interprets the asterisks as markup) There's some special magic in filter query processing to handle this case, but not in the main query parser. Best, Erick On Wed, Jan 7, 2015 at 8:14 AM, Clemens Wyss DEV clemens...@mysign.ch wrote: Say I wanted to find documents which have no content in field1 (or dosuments that have no field 'field1'), wouldn't that be the following query? -field1:[* TO *] Thanks for you help Clemens - To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org - To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org
Re: Looking for docs that have certain fields empty (an/or not set)
Hi Clemens, Since you are a lucene user, you might be interested in Uwe's response on a similar topic : http://find.searchhub.org/document/abb73b45a48cb89e Ahmet On Wednesday, January 7, 2015 6:30 PM, Erick Erickson erickerick...@gmail.com wrote: Should be, but it's a bit confusing because the query syntax is not pure boolean, so there's no set to take away the docs with entries in field 1, you need the match all docs bit, i.e. *:* -field1:[* TO *] (That's asterisk:asterisk -field1:[* TO *] in case the silly list interprets the asterisks as markup) There's some special magic in filter query processing to handle this case, but not in the main query parser. Best, Erick On Wed, Jan 7, 2015 at 8:14 AM, Clemens Wyss DEV clemens...@mysign.ch wrote: Say I wanted to find documents which have no content in field1 (or dosuments that have no field 'field1'), wouldn't that be the following query? -field1:[* TO *] Thanks for you help Clemens - To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org - To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org - To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org