Re: Can the BooleanQuery execution be optimized with same term queries?

2023-09-19 Thread Michael Sokolov
y.I am encounterd by a question about the execution > of BooleanQuery:although,BooleanQuery#rewrite has done some works to > remove duplicate FILTER,SHOULD clauses.however still the same term query > can been executed the several times. > > I copy the test code in the Tes

Can the BooleanQuery execution be optimized with same term queries?

2023-09-18 Thread YouPeng Yang
Hi All During my unemployment time ,the happiest thing is diving to study the Lucene Source Code ,thanks for all the work . About the BooleanQuery.I am encounterd by a question about the execution of BooleanQuery:although,BooleanQuery#rewrite has done some works to remove duplicate FILTER

Re: BooleanQuery: BooleanClause.Occur.MUST_NOT seems to require at least one BooleanClause.Occur.MUST

2020-11-06 Thread Uwe Schindler
020, 08:43:59 AM EST, Erick Erickson > wrote: > > Nissim: > >Here’s a good explanation of why it was designed this way >if you’d like details: > >https://lucidworks.com/post/why-not-and-or-and-not/ > >Don’t be put off by the Solr title, it’s really about >BooleanQu

Re: BooleanQuery: BooleanClause.Occur.MUST_NOT seems to require at least one BooleanClause.Occur.MUST

2020-11-06 Thread Nissim Shiman
really about BooleanQuery and BooleanClause Best, Erick > On Nov 6, 2020, at 8:17 AM, Adrien Grand wrote: > > Hi Nissim, > > This is by design: boolean queries that don't have positive clauses like > empty boolean queries or boolean queries that only consist of negative >

Re: BooleanQuery: BooleanClause.Occur.MUST_NOT seems to require at least one BooleanClause.Occur.MUST

2020-11-06 Thread Erick Erickson
Nissim: Here’s a good explanation of why it was designed this way if you’d like details: https://lucidworks.com/post/why-not-and-or-and-not/ Don’t be put off by the Solr title, it’s really about BooleanQuery and BooleanClause Best, Erick > On Nov 6, 2020, at 8:17 AM, Adrien Grand wr

Re: BooleanQuery: BooleanClause.Occur.MUST_NOT seems to require at least one BooleanClause.Occur.MUST

2020-11-06 Thread Adrien Grand
ers, > I have found that constructing a BooleanQuery with just > a BooleanClause.Occur.MUST_NOT will return no results. It will return > results is if there is also a BooleanClause.Occur.MUST as part of the query > as well though. > > > I don't see this limit

BooleanQuery: BooleanClause.Occur.MUST_NOT seems to require at least one BooleanClause.Occur.MUST

2020-11-05 Thread Nissim Shiman
Hello Apache Lucene team members, I have found that constructing a BooleanQuery with just a  BooleanClause.Occur.MUST_NOT will return no results.  It will return results is if there is also a BooleanClause.Occur.MUST as part of the query as well though. I don't see this limitation w

Re: BooleanQuery normal form

2020-09-27 Thread Michael McCandless
Hi Patrick, I don't think Lucene supports CNF or DNF for BooleanQuery? BooleanQuery will try to do some rewriting simplifications for degenerate cases, e.g. a BooleanQuery with a single clause. Probably it could do more optimizing? It is quite complex already :) Mike On Tue, Sep 22, 20

BooleanQuery normal form

2020-09-22 Thread Haoyu Zhai
Hi there, Does Lucene support normalizing a BooleanQuery into normalized form (like CNF or DNF)? If not, is there a suggested way of doing it? Also, I wonder whether there'll be a performance difference between different forms of essentially the same BooleanQuery? Thanks Patrick

Re: how to find out each score contribution from booleanquery components

2019-06-28 Thread baris . kazar
xed for field 'countryDFLT' (let alone both). Do the individual building blocks, eg. "countryDFLT:united" return any results? On Thu, Jun 27, 2019 at 4:33 PM wrote: Hi,- Any ideas on what might be happening? maybe i am missing, is there an api to look into each contribution of score

Re: how to find out each score contribution from booleanquery components

2019-06-27 Thread baris . kazar
ng this query on does not seem to have a document where either 'united' or 'states' has been indexed for field 'countryDFLT' (let alone both). Do the individual building blocks, eg. "countryDFLT:united" return any results? On Thu, Jun 27, 2019 at 4:33 PM wrot

Re: how to find out each score contribution from booleanquery components

2019-06-27 Thread baris . kazar
, eg. "countryDFLT:united" return any results? On Thu, Jun 27, 2019 at 4:33 PM wrote: Hi,- Any ideas on what might be happening? maybe i am missing, is there an api to look into each contribution of score into total scrore from the booleanquery? Best regards On 6/26/19 2:29 PM, Ba

Re: how to find out each score contribution from booleanquery components

2019-06-27 Thread Erick Erickson
#x27; has been > indexed for field 'countryDFLT' (let alone both). Do the individual > building blocks, eg. "countryDFLT:united" return any results? > > On Thu, Jun 27, 2019 at 4:33 PM wrote: >> >> Hi,- >> >> Any ideas on what might be happ

Re: how to find out each score contribution from booleanquery components

2019-06-27 Thread András Péteri
x27;countryDFLT' (let alone both). Do the individual building blocks, eg. "countryDFLT:united" return any results? On Thu, Jun 27, 2019 at 4:33 PM wrote: > > Hi,- > > Any ideas on what might be happening? > > maybe i am missing, is there an api to look into each contribu

Re: how to find out each score contribution from booleanquery components

2019-06-27 Thread baris . kazar
Hi,- Any ideas on what might be happening? maybe i am missing, is there an api to look into each contribution of score into total scrore from the booleanquery? Best regards On 6/26/19 2:29 PM, Baris Kazar wrote: All must queries (and the rest of course) work ok when i search MAINK, MAINL

Re: how to find out each score contribution from booleanquery components

2019-06-26 Thread Baris Kazar
booleanquery separately and then manually post process them. or my query plan is still not good enough to catch MAIN when i search with street MAINS, city NASUA, municipality HILLSBOROUGH, state NEW HAMPSHIRE, cuntry UNITED STATES where the first two are fuzzy as they are have errors in them and

Re: how to find out each score contribution from booleanquery components

2019-06-26 Thread Atri Sharma
ery’s type (phrase, term etc). > > > > Could you post your query and the explain plan of IndexSearcher post the > > rewrite? > > > > On Wed, 26 Jun 2019 at 6:46 PM, wrote: > > > >> Hi,- > >> > >>how can one find out each score c

Re: how to find out each score contribution from booleanquery components

2019-06-26 Thread baris . kazar
This is a nested (2-level in this case) booleanquery. Best regards On 6/26/19 1:06 PM, baris.ka...@oracle.com wrote: Sure, here is the query plan: (i cant run explain plan as it does not give me anything) [+streetDFLT:maink~2 (streetDFLT:"maine")^0.35, +cityDFLT:nasua~2 (cityD

Re: how to find out each score contribution from booleanquery components

2019-06-26 Thread baris . kazar
ery and the explain plan of IndexSearcher post the rewrite? On Wed, 26 Jun 2019 at 6:46 PM, wrote: Hi,- how can one find out each score contribution from booleanquery components? Best regards - To unsubscribe, e-mail: ja

Re: how to find out each score contribution from booleanquery components

2019-06-26 Thread Atri Sharma
ach score contribution from booleanquery > components? > > Best regards > > > - > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache

how to find out each score contribution from booleanquery components

2019-06-26 Thread baris . kazar
Hi,-  how can one find out each score contribution from booleanquery components? Best regards - To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org

Re: CustomQuery.bulkScorer isn't called from BooleanQuery with filter block

2018-07-26 Thread Adrien Grand
()? > > Unfortunately this is illegal: queries must implement scorer(). Today, > > conjunctions never use the bulkScorer API. > > > > Le mer. 25 juil. 2018 à 18:47, Vadim Gindin a > > écrit : > > > > > Hi all! > > > > > >

Re: CustomQuery.bulkScorer isn't called from BooleanQuery with filter block

2018-07-26 Thread Vadim Gindin
dim Gindin a > écrit : > > > Hi all! > > > > I have the following BooleanQuery (JSON representation as it is defined > in > > Elasticsearch): > > > > { > > "query" : { > > &qu

Re: CustomQuery.bulkScorer isn't called from BooleanQuery with filter block

2018-07-25 Thread Adrien Grand
following BooleanQuery (JSON representation as it is defined in > Elasticsearch): > > { > "query" : { > "bool" : { > "must" : { > "custom_query" : { // has own bulkScorer() imp

CustomQuery.bulkScorer isn't called from BooleanQuery with filter block

2018-07-25 Thread Vadim Gindin
Hi all! I have the following BooleanQuery (JSON representation as it is defined in Elasticsearch): { "query" : { "bool" : { "must" : { "custom_query" : { // has own bulkScorer() implementation

Lucene BooleanQuery with some TermQuery's having BooleanClause.Occur set MUST for all

2018-07-18 Thread baris . kazar
Hi,- i have an indexed field having "$word1 word2" and i want to find the docs having these two words first in my first query. i have another indexed field but i am not searching on that second field for this first query which is BooleanQuery with two TermQuer

Re: Get matching fields from a BooleanQuery

2017-06-22 Thread Frederik Van Hoyweghen
t; 0.75 = parameter b > 28.2 = avgFieldLength > 28.45 = fieldLength" > > > > > > How to know the matching fields from an Explanation Object? > > > Regards, > Ranganath B. N. > > > -----Original Message- > From: Adri

RE: Get matching fields from a BooleanQuery

2017-06-22 Thread Ranganath B N
ds from an Explanation Object? Regards, Ranganath B. N. -Original Message- From: Adrien Grand [mailto:jpou...@gmail.com] Sent: Thursday, June 22, 2017 12:55 PM To: java-user@lucene.apache.org Subject: Re: Get matching fields from a BooleanQuery Hi Frederik, Using explain should be fine fo

Re: Get matching fields from a BooleanQuery

2017-06-22 Thread Adrien Grand
everyone, > > To start, we are using Lucene 4.3. > > To search, we prepare several queries and combine these into a > BooleanQuery. > What we are looking for is a way to determine on which specific fields a > certain document matched. > For example, I create 2 queries: one t

Get matching fields from a BooleanQuery

2017-06-19 Thread Frederik Van Hoyweghen
Hey everyone, To start, we are using Lucene 4.3. To search, we prepare several queries and combine these into a BooleanQuery. What we are looking for is a way to determine on which specific fields a certain document matched. For example, I create 2 queries: one to search in the "Name"

Re: Is there some sensible way to do giant BooleanQuery or similar lazily?

2017-04-03 Thread Trejkaz
On Mon, Apr 3, 2017 at 6:25 PM, Adrien Grand wrote: > Large boolean queries can cause a lot of random access as each sub clause > is advanced one after the other. Even in the case that everything fits in > the filesystem cache, the fact that the heap needs to be rebalanced after > each documents m

Re: Is there some sensible way to do giant BooleanQuery or similar lazily?

2017-04-03 Thread Adrien Grand
eaf is returned. Which > is confusing, and seems backwards. > > As an alternative, we could override rewrite(IndexReader) and return a > gigantic boolean query. Problems being: > > 1) A gigantic BooleanQuery takes up a lot more memory than a list of > query strings. > >

Is there some sensible way to do giant BooleanQuery or similar lazily?

2017-04-02 Thread Trejkaz
, the larger doc ID set is sliced so that the sub-slice for that leaf is returned. Which is confusing, and seems backwards. As an alternative, we could override rewrite(IndexReader) and return a gigantic boolean query. Problems being: 1) A gigantic BooleanQuery takes up a lot more memory than a

Re: Migrate BooleanQuery Lucene 4.9.0 to Lucene 6.0.3

2016-11-10 Thread Humberto Rocha
Oliver, worked perfectly! Thanks a lot ! Best regards, Humberto On Thu, Nov 10, 2016 at 8:37 AM, Oliver Kaleske wrote: > Hi, > > try > BooleanQuery inner = new BooleanQuery.Builder().add(ownerQueryX, > Occur.SHOULD).add(groupQueryY, Occur.SHOULD).build(); >

RE: Migrate BooleanQuery Lucene 4.9.0 to Lucene 6.0.3

2016-11-10 Thread Oliver Kaleske
Hi, try BooleanQuery inner = new BooleanQuery.Builder().add(ownerQueryX, Occur.SHOULD).add(groupQueryY, Occur.SHOULD).build(); BooleanQuery constrainedQuery = new BooleanQuery.Builder().add(inner, Occur.MUST).add(query, Occur.MUST).build(); You can also split this into several

Migrate BooleanQuery Lucene 4.9.0 to Lucene 6.0.3

2016-11-09 Thread Humberto Rocha
Hi, In Lucene 4.9.0 i have: QueryParser parser = new QueryParser("contents",analisador); Query query = parser.parse(parametro); BooleanQuery constrainedQuery = new BooleanQuery(); BooleanQuery inner = new BooleanQuery(); inner.add(ownerQueryX, Oc

RE: How to build a Lucene BooleanQuery?

2016-09-21 Thread szzoli
And this works with Lucene 6.2 -- View this message in context: http://lucene.472066.n3.nabble.com/How-to-build-a-Lucene-BooleanQuery-tp4297102p4297153.html Sent from the Lucene - Java Users mailing list archive at Nabble.com

RE: How to build a Lucene BooleanQuery?

2016-09-21 Thread szzoli
, BooleanClause.Occur.MUST); builder.add(subQuery2, BooleanClause.Occur.MUST_NOT); BooleanQuery bq = builder.build(); -- View this message in context: http://lucene.472066.n3.nabble.com/How-to-build-a-Lucene-BooleanQuery-tp4297102p4297150.html Sent from the Lucene - Java Users

RE: How to build a Lucene BooleanQuery?

2016-09-21 Thread Uwe Schindler
age- > From: Chaitanya Kumar Ch [mailto:chaitu381...@gmail.com] > Sent: Wednesday, September 21, 2016 1:20 PM > To: java-user@lucene.apache.org > Subject: Re: How to build a Lucene BooleanQuery? > > I am able to create BooleanQuery using > BooleanQuery categoryQuery = ne

Re: How to build a Lucene BooleanQuery?

2016-09-21 Thread Chaitanya Kumar Ch
I am able to create BooleanQuery using BooleanQuery categoryQuery = new BooleanQuery(); I don't understand why you said it does not exist. On Wed, Sep 21, 2016 at 4:39 PM, szzoli wrote: > Thank you. > > This is almost the solution, but how can I build a BoolesanQuery? > T

AW: How to build a Lucene BooleanQuery?

2016-09-21 Thread Oliver Kaleske
Try BooleanQuery.Builder builder = new BooleanQuery.Builder(); builder.add(subQuery1, occur1); builder.add(subQuery2, occur2); // ... BooleanQuery query = builder.build(); -Ursprüngliche Nachricht- Von: szzoli [mailto:reg9sz...@freemail.hu

Re: How to build a Lucene BooleanQuery?

2016-09-21 Thread szzoli
Thank you. This is almost the solution, but how can I build a BoolesanQuery? The BooleanQuery categoryQuery = new BooleanQuery(); does not exist, the builder.createBooleanQuery(field, queryString); creats a TermQuery. -- View this message in context: http://lucene.472066.n3.nabble.com/How

Re: How to build a Lucene BooleanQuery?

2016-09-21 Thread Chaitanya Kumar Ch
May be it <http://stackoverflow.com/questions/20204726/lucene-or-search-using-boolean-query>helps you. On Wed, Sep 21, 2016 at 4:11 PM, szzoli wrote: > Hi, > > I would like to build a BooleanQuery. This migt be simple, but I cannot > find > the way how to do it. > I

How to build a Lucene BooleanQuery?

2016-09-21 Thread szzoli
Hi, I would like to build a BooleanQuery. This migt be simple, but I cannot find the way how to do it. It is also silly that the function builder.createBooleanQuery(field, queryString, BooleanClause.Occur.MUST); builds a TermQuery. How can I bild such a query like "fox MUST dog MUST_NOT&qu

Re: Combination of BooleanQuery and PhraseQuery

2016-08-15 Thread Erik Hatcher
re any query similar to BooleanQuery with SHOULD semantics that prefer > documents where the terms are close to each other? > I currently use a PhraseQuery with large slop for this. However this only > works if all the terms are in the document. > >

Combination of BooleanQuery and PhraseQuery

2016-08-15 Thread Erel Uziel
Hi, Is there any query similar to BooleanQuery with SHOULD semantics that prefer documents where the terms are close to each other? I currently use a PhraseQuery with large slop for this. However this only works if all the terms are in the document. Best regards, Erel Uziel

Re: BooleanQuery rewrite optimization

2016-08-14 Thread Spyros Kapnissis
lly diff > > query that won't match as many documents as the original. > > > > in that example, you could decrement minshouldmatch (=1) ... but i'm not > > sure off that holds as a general rule for all possible > permutations/values > > ... i'd have

Re: BooleanQuery rewrite optimization

2016-08-13 Thread Adrien Grand
t; > > in that example, you could decrement minshouldmatch (=1) ... but i'm not > > sure off that holds as a general rule for all possible > permutations/values > > ... i'd have to think about it. > > > > An interesting edge case to think about is "(X X Y #X)&

Re: BooleanQuery rewrite optimization

2016-08-13 Thread Spyros Kapnissis
ut is "(X X Y #X)" w/minshouldmatch=2 > ... pretty sure that would give you very diff scores if you rewrote it to > "(+X X Y)" (or "(+X Y)") w/minshouldmatch=1 > > > > : Hello all, I noticed while debugging a query that BooleanQuery will > : re

Re: BooleanQuery rewrite optimization

2016-08-10 Thread Adrien Grand
le for all possible permutations/values > ... i'd have to think about it. > > An interesting edge case to think about is "(X X Y #X)" w/minshouldmatch=2 > ... pretty sure that would give you very diff scores if you rewrote it to > "(+X X Y)" (or "(+X Y)

Re: BooleanQuery rewrite optimization

2016-08-08 Thread Spyros Kapnissis
se to think about is "(X X Y #X)" w/minshouldmatch=2 ... pretty sure that would give you very diff scores if you rewrote it to "(+X X Y)" (or "(+X Y)") w/minshouldmatch=1 : Hello all, I noticed while debugging a query that BooleanQuery will : rewrite itself to remo

Re: BooleanQuery rewrite optimization

2016-08-08 Thread Chris Hostetter
ot;(X X Y #X)" w/minshouldmatch=2 ... pretty sure that would give you very diff scores if you rewrote it to "(+X X Y)" (or "(+X Y)") w/minshouldmatch=1 : Hello all, I noticed while debugging a query that BooleanQuery will : rewrite itself to remove FILTER clauses that

BooleanQuery rewrite optimization

2016-08-08 Thread Spyros Kapnissis
Hello all, I noticed while debugging a query that BooleanQuery will rewrite itself to remove FILTER clauses that are also MUST as an optimization/simplification, which makes total sense. So (+f:x #f:x) will become (+f:x). However, shouldn't there also be another optimization to remove F

Re: What is the difference between PhraseQuery and BooleanQuery with BooleanClause.Occur.SHOULD

2016-04-01 Thread Sachin Kulkarni
I got the answer. Somehow I missed it. The PhraseQuery requires the terms to be in a fixed order whereas the BooleanQuery does not require the terms to be in a particular order. On Thu, Mar 31, 2016 at 3:07 PM, Sachin Kulkarni wrote: > Hi, > > I am using Lucene-5.0.0. > If I had

What is the difference between PhraseQuery and BooleanQuery with BooleanClause.Occur.SHOULD

2016-03-31 Thread Sachin Kulkarni
Hi, I am using Lucene-5.0.0. If I had a qurey "New York" and if I use the BooleanQuery with the BooleanClause set to MUST on the two terms, is it the same as dong a PhraseQuery with the two terms? I am doing some 2-gram type queries and they are giving me different results with these t

Combining BooleanQuery with DisjunctionMaxQuery

2016-01-29 Thread Michał Klecha
Hi, I'm facing the problem solve to which appears to be just few simple lines but i cannot manage to find them. I'm using Lucene, 5.4.0 What I'm trying to do is to compose a complex BooleanQuery and at the end I need to find an intersection of all subqueries without summing scor

Re: De-Serializing a query string into BooleanQuery without analyzing

2015-08-04 Thread rahul challapalli
and I am struck > during the last step > 1. Construct a BooleanQuery > 2. Serialize BooleanQuery into a String > 3. De-Serialize a String into a BooleanQuery (or a Query) on a > different machine. > > Eg : Lets say from step(2) I got the below string. > +contents:maxI

De-Serializing a query string into BooleanQuery without analyzing

2015-08-03 Thread rahul challapalli
Hi, I am trying to accomplish the below sequence of tasks and I am struck during the last step 1. Construct a BooleanQuery 2. Serialize BooleanQuery into a String 3. De-Serialize a String into a BooleanQuery (or a Query) on a different machine. Eg : Lets say from step(2) I got the

MemoryIndex slow for BooleanQuery with non-required clause

2015-02-23 Thread Ryan, Michael F. (LNG-DAY)
(I'm using Lucene 4.9.0) I've been doing some perf testing of MemoryIndex, and have found that it is much slower when a BooleanQuery contains a non-required clause, compared to when it just contains required clauses. Most of the time is spent in BooleanScorer, which as far as I can

Re: MultiPhraseQuery:Rewrite to BooleanQuery

2015-01-21 Thread dennis yermakov
y.toStirng() method, like: (termA termB) termC it can be "termA termC" OR "termB termC" So my question is, how can I rewrite MultiPhraseQuery to BooleanQuery with PhraseQuery clauses or something else to get matched terms. Can it possible at all and will these queries equal (scoring,

Re: MultiPhraseQuery:Rewrite to BooleanQuery

2015-01-21 Thread Ian Lea
Are you asking if your two suggestions 1) a MultiPhraseQuery or 2) a BooleanQuery made up of multiple PhraseQuery instances are equivalent? If so, I'd say that they could be if you build them carefully enough. For the specific examples you show I'd say not and would wonder if you g

Re: MultiPhraseQuery:Rewrite to BooleanQuery

2015-01-21 Thread ku3ia
olate")); > q.add(new Term[] {new Term("body", "pie"), new Term("body", "tart")}); > assertEquals(2, searcher.search(q, 1).totalHits); > r.close(); > indexStore.close(); > > I need to know on which phrase query will be match. Explanat

MultiPhraseQuery:Rewrite to BooleanQuery

2015-01-12 Thread ku3ia
t;), new Term("body", "tart")}); assertEquals(2, searcher.search(q, 1).totalHits); r.close(); indexStore.close(); I need to know on which phrase query will be match. Explanation doesn't return exact information, only that is match by this query. So can I rewrite this query to Bo

MultiPhraseQuery:Rewrite to BooleanQuery

2015-01-12 Thread dennis yermakov
t;), new Term("body", "tart")}); assertEquals(2, searcher.search(q, 1).totalHits); r.close(); indexStore.close(); I need to know on which phrase query will be match. Explanation doesn't return exact information, only that is match by this query. So can I rewrite this query to Bo

Re: BooleanFilter vs BooleanQuery performance

2013-12-16 Thread Christoph Kaser
Hi, thank you for your explanation! I used a wrapped BooleanQuery instead, this turned out to be a lot faster. Christoph Am 16.12.2013 15:19, schrieb Uwe Schindler: Hi, The problem with BooleanFilter is its implementation: It creates BitSets and AND/ORs them together. The BitSets are created

RE: BooleanFilter vs BooleanQuery performance

2013-12-16 Thread Uwe Schindler
you have Queries that only match little documents, the other queries can then advance and leave out the doc ids not matching. BooleanFilter has to get all matching docIds from all filters. If you want it fast, use BooleanQuery and wrap it with ConstantScoreQuery. Then there is also no scoring

BooleanFilter vs BooleanQuery performance

2013-12-16 Thread Christoph Kaser
Hi all, from my tests on an index with 22 million entries, it seems that in many cases a BooleanFilter is a lot slower than an equivalent BooleanQuery. Is this the expected behaviour? i would have expected a Filter to be at least as fast as a query, since it basically does the same thing, but

Re: QueryParser.Operator with BooleanQuery

2013-11-19 Thread Alan Woodward
in the results. > > Since then, however, we've needed to query more flexibly, using a > BooleanQuery to merge several subqueries (in order to apply different > analyzers to different fields/field groups). As a result, we've had to > switch to Operator.OR, since there w

QueryParser.Operator with BooleanQuery

2013-11-18 Thread Shahak Nagiel
Initially, I queried our (v4.4) index with a single MultiFieldQueryParser and  Operator.AND to ensure that all search terms appeared in the results. Since then, however, we've needed to query more flexibly, using a BooleanQuery to merge several subqueries (in order to apply different anal

Re: SpanQuery, Filter, BooleanQuery

2012-10-30 Thread Carsten Schnober
it to a SpanQuery using SpanMultiTermQueryWrapper. Answer b) seems intuitively the way to go there, but I don't quite find the correct path there because the filter does not work as intended (see my previous post). Answer a) does not seem feasible here either because SpanMultiTermQueryWrapper requires a MultiTerm

SpanQuery, Filter, BooleanQuery

2012-10-29 Thread Carsten Schnober
; docBase" [1] in which Uwe suggests not to use QueryWrapperFilter, but to use another Query and to combine it using a Boolean Query in such a scenario, if I understand correctly. Does this still claim for Lucene 4.0? However, I am not sure how to use a BooleanQuery here because I need the SpanQuery result. An

Re: Using coord of one BooleanQuery as a multiplier for its siblings

2012-09-13 Thread pranshu
Any ideas on this? Thanks! -- View this message in context: http://lucene.472066.n3.nabble.com/Using-coord-of-one-BooleanQuery-as-a-multiplier-for-its-siblings-tp4003736p4007675.html Sent from the Lucene - Java Users mailing list archive at Nabble.com

Re: Using coord of one BooleanQuery as a multiplier for its siblings

2012-09-07 Thread pranshu
Ah yes, that is what I meant by coord = 1. Coord is disabled for BQ0 and BQ2. -- View this message in context: http://lucene.472066.n3.nabble.com/Using-coord-of-one-BooleanQuery-as-a-multiplier-for-its-siblings-tp4003736p4006220.html Sent from the Lucene - Java Users mailing list archive at

Re: Using coord of one BooleanQuery as a multiplier for its siblings

2012-08-29 Thread Robert Muir
On Mon, Aug 27, 2012 at 8:31 PM, pranshu sharma wrote: > Hi there, > > I had a question about migrating the coord value one level up. My current > query structure has a root BooleanQuery with a bunch of nested BooleanQuery > children: one of these looks for all terms in the quer

Using coord of one BooleanQuery as a multiplier for its siblings

2012-08-28 Thread pranshu sharma
Hi there, I had a question about migrating the coord value one level up. My current query structure has a root BooleanQuery with a bunch of nested BooleanQuery children: one of these looks for all terms in the query issued, and I want to apply the coord factor for this BooleanQuery to all its

Re: Use an analyzer with Term, FuzzyQuery, BooleanQuery and friends

2012-08-27 Thread Jack Krupansky
@lucene.apache.org Subject: Use an analyzer with Term, FuzzyQuery, BooleanQuery and friends Hello list I build my queries programmatically with Term, NumericTerm, FuzzyQuery, BooleanQuery etc. In particular, I do not use QueryParser to build my query from a string. Still, I would like to

Use an analyzer with Term, FuzzyQuery, BooleanQuery and friends

2012-08-27 Thread Damian Birchler
Hello list I build my queries programmatically with Term, NumericTerm, FuzzyQuery, BooleanQuery etc. In particular, I do not use QueryParser to build my query from a string. Still, I would like to first run the values for my terms through an analzyer (more precisely, the same analyzer that I

Re: Question about BooleanQuery

2012-08-23 Thread Jack Krupansky
August 23, 2012 9:13 AM To: java-user@lucene.apache.org Subject: Re: Question about BooleanQuery OK, it's not the idea that the nested NOT query has got anything to do with booleanField_1, so I'll try to phrase very clearly what I want : the query should return docs where ( someField

Re: Question about BooleanQuery

2012-08-23 Thread heikki
this message in context: http://lucene.472066.n3.nabble.com/Question-about-BooleanQuery-tp4002822p4002854.html Sent from the Lucene - Java Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: java-user-unsubscr...@lu

Re: Question about BooleanQuery

2012-08-23 Thread Jack Krupansky
cene.apache.org Subject: Re: Question about BooleanQuery thanks Jack for your answer, however I'm not quite sure what to do with it: the query is like +( someField_1:0 someField_2:0 ) +booleanField_1:false -( +( someField_1:0 someField_2:0 ) +booleanField_2:true ) (I put

Re: Question about BooleanQuery

2012-08-23 Thread heikki
http://lucene.472066.n3.nabble.com/Question-about-BooleanQuery-tp4002822p4002836.html Sent from the Lucene - Java Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For addition

Re: Question about BooleanQuery

2012-08-23 Thread Jack Krupansky
Step 1, fully parenthesize your boolean to show your desired order of execution. The Lucene BooleanQuery does not do a pure Boolean evaluation. You have the same sub-expression in your NOT clause - that's probably what guarantees zero results. And you have an unmatched right parenthesis a

Question about BooleanQuery

2012-08-23 Thread heikki
View this message in context: http://lucene.472066.n3.nabble.com/Question-about-BooleanQuery-tp4002822.html Sent from the Lucene - Java Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: java-user-unsubscr...@l

Re: QueryParser and BooleanQuery

2012-07-26 Thread Deepak Shakya
Hi Trejkaz, I am using the Standard Analyzer for my indexing. Can you provide an example with which I can use the BooleanQuery to add both the fields in the same forms and yet the documents are searched? I would be really grateful if you can provide example for parsing the text as well which is

Re: QueryParser and BooleanQuery

2012-07-23 Thread Trejkaz
On Mon, Jul 23, 2012 at 10:16 PM, Deepak Shakya wrote: > Hey Jack, > > Can you let me know how should I do that? I am using the Lucene 3.6 version > and I dont see any parse() method for StandardAnalyzer. In your case, presumably at indexing time you should be using a PerFieldAnalyzerWrapper with

Re: QueryParser and BooleanQuery

2012-07-23 Thread Ian Lea
QueryParser returns a query. Just add that to the BooleanQuery. QueryParser qp = ...; BooleanQuery bq = new BooleanQuery(); Query parsedq = qp.parse("...); bq.add(parsedq, ...); -- Ian. On Mon, Jul 23, 2012 at 1:16 PM, Deepak Shakya wrote: > Hey Jack, > > Can you let me kno

Re: QueryParser and BooleanQuery

2012-07-23 Thread Deepak Shakya
Sunday, July 22, 2012 9:35 PM > To: java-user@lucene.apache.org > Subject: Re: QueryParser and BooleanQuery > > > I tried changing the case to lower case, but still the BooleanQuery doesn't > return any documents. > > I see that the text "/blank" is converte

Re: QueryParser and BooleanQuery

2012-07-22 Thread Jack Krupansky
-Original Message- From: Deepak Shakya Sent: Sunday, July 22, 2012 9:35 PM To: java-user@lucene.apache.org Subject: Re: QueryParser and BooleanQuery I tried changing the case to lower case, but still the BooleanQuery doesn't return any documents. I see that the text "

Re: QueryParser and BooleanQuery

2012-07-22 Thread Deepak Shakya
I tried changing the case to lower case, but still the BooleanQuery doesn't return any documents. I see that the text "/blank" is converted to "blank" in the QueryParser. But in BooleanQuery it remains the same. When I remove the forward slash sign from the input

Re: QueryParser and BooleanQuery

2012-07-22 Thread Jack Krupansky
The query parser/analyzer is lower-casing the query terms automatically. You have to do the same with with terms for BooleanQuery - Term("cs-method", "GET") should be "Term("cs-method", "get")". StandardAnalyzer is doing the lower-casing. -

QueryParser and BooleanQuery

2012-07-22 Thread Deepak Shakya
500 567 2010-04-21 02:24:04 GET /blank 200 897 2010-04-21 02:24:04 POST /blank 200 567 2010-04-21 02:24:05 GET /US/search 200 658 2010-04-21 02:24:05 POST /US/shop 200 768 2010-04-21 02:24:05 GET /blank 200 347 I am querying it in two ways, first with QueryParser and other with BooleanQuery

RES: BrazilianAnalyzer don't woks with any BooleanQuery

2012-07-12 Thread Marcelo Neves
th this analyzer. In the code attached to "searchExpresion" is the phrase containing the words entered to search by the end user. I do search containing all the words, or any of the words or the whole phrase. This method makes my object "BooleanQuery" only for the content (f

Re: BrazilianAnalyzer don't woks with any BooleanQuery

2012-07-12 Thread Simon Willnauer
arch using any analyzed field with BrazilianAnalyzer, > always a return empty result (zero docs). I do test in separeted solution > with a unique field with Brazilian Analyzer in indexing and searching. If > use a BooleanQuery and not queryparse, don't works as expected. Return > empty

BrazilianAnalyzer don't woks with any BooleanQuery

2012-07-11 Thread Marcelo Neves
ution with a unique field with Brazilian Analyzer in indexing and searching. If use a BooleanQuery and not queryparse, don't works as expected. Return empty result. When change for StandardAnalyzer on Indexing and Serching, without alter other parts of code, works. Could anyone help

Re: Differences between BooleanQuery and QueryParser

2012-01-30 Thread Erick Erickson
don Mintern wrote: > >> A QueryParser has to actually parse your text and build up the >> BooleanQuery exactly as you do in your second example. Since the >> QueryParser is doing extra work that you don't have to do considering >> that you already know everything ab

Re: Differences between BooleanQuery and QueryParser

2012-01-30 Thread Felipe Carvalho
Has anyone ever measured the difference? Could it make a 10%+ difference on a search involving around 5 terms? On Mon, Jan 30, 2012 at 8:05 PM, Brandon Mintern wrote: > A QueryParser has to actually parse your text and build up the > BooleanQuery exactly as you do in your second example.

Re: Differences between BooleanQuery and QueryParser

2012-01-30 Thread Brandon Mintern
A QueryParser has to actually parse your text and build up the BooleanQuery exactly as you do in your second example. Since the QueryParser is doing extra work that you don't have to do considering that you already know everything about the query, your second example is faster. On Mon, J

Re: BooleanQuery and NOT-Operator

2011-11-03 Thread Ian Lea
I guess you're confusing it with MUST (MUST_NOT) logic. Try creating the query you want to exclude without MUST_NOT and add it to the BooleanQuery with MUST_NOT. That sounds very confusing. For example BooleanQuery bq = new BooleanQuery(); TermQuery tqwanted = new TermQuery(new Term(&q

BooleanQuery and NOT-Operator

2011-11-03 Thread Kolhoff, Jacqueline - ENCOWAY
Hi, I have a problem when using BooleanQuery with NOT-Operators. When I want to search my documents for elements where a special field is NOT a special value AND another field is a special value, I do the following in my code: Query query1 = ...; // -field1:value1 Query query2=...; // field2

Re: Problem with BooleanQuery

2011-09-22 Thread Peyman Faratin
tting_no_hits_.2BAC8_incorrect_hits.3F > for more things to check. i'll walk through them as soon as i can. > >> Do you think booleanquery is the right approach for solving the problem >> (finding lucene score of a word or a phrase in _a_ particular document)? > > So

  1   2   3   4   >