Re: Access child boolean query matched terms in parent custom wrapper query

2023-07-17 Thread Mikhail Khludnev
Hello Igor, Accessing a potential match during scoring is problematic. Piggibacking on wrapped boolean query is not an option because when a certain docId is collected matching legs might reside on previous or next docID. You can check these for the inspiration https://lucene.apache.org/core/9_0_0

Re: Access child boolean query matched terms in parent custom wrapper query

2023-07-17 Thread Igor Kustov
Terms)); > return queryTerms; > } > > In topDocs you will have the matched documents. And in matchedTerms you > will have the corresponding terms that are matching. > I hope this helps you. > > Ned > > Von: Igor Kustov > Gesende

AW: Access child boolean query matched terms in parent custom wrapper query

2023-07-17 Thread nedyalko.zhe...@freelance.de.INVALID
he.org Betreff: Access child boolean query matched terms in parent custom wrapper query I'm writing custom lucene query which is basically a wrapper around boolean query with many should clauses. I want to access this boolean query's matched terms, and then either filter out this docum

Access child boolean query matched terms in parent custom wrapper query

2023-07-17 Thread Igor Kustov
I'm writing custom lucene query which is basically a wrapper around boolean query with many should clauses. I want to access this boolean query's matched terms, and then either filter out this document depending on external statistics on those terms or proceed with this document without

Re: Optimizing a boolean query for 100s of term clauses

2020-06-25 Thread Alex K
Hi Tommaso, thanks for the input and links! I'll add your paper to my literature review. So far I've seen very promising results from modifying the TermInSetQuery. It was pretty simple to keep a map of `doc id -> matched term count` and then only evaluate the exact similarity on the top k doc ids.

Re: Optimizing a boolean query for 100s of term clauses

2020-06-25 Thread Toke Eskildsen
On Wed, 2020-06-24 at 13:46 -0400, Alex K wrote: > My implementation isn't specific to any particular dataset or access > pattern (i.e. infinite vs. subset). Without a clearly defined use case, I would say that the sequential scan approach is not the right one: As these things goes, someone will

Re: Optimizing a boolean query for 100s of term clauses

2020-06-25 Thread Tommaso Teofili
hi Alex, I had worked on a similar problem directly on Lucene (within Anserini toolkit) using LSH fingerprints of tokenized feature vector values. You can find code at [1] and some information on the Anserini documentation page [2] and in a short preprint [3]. As a side note my current thinking is

Re: Optimizing a boolean query for 100s of term clauses

2020-06-24 Thread Alex K
Hi Toke. Indeed a nice coincidence. It's an interesting and fun problem space! My implementation isn't specific to any particular dataset or access pattern (i.e. infinite vs. subset). So far the plugin supports exact L1, L2, Jaccard, Hamming, and Angular similarities with LSH variants for all but

Re: Optimizing a boolean query for 100s of term clauses

2020-06-24 Thread Alex K
ick response! > > > > > > I will look into the TermInSetQuery. > > > > > > My usage of "heap" might've been confusing. > > > I'm using a FunctionScoreQuery from Elasticsearch. > > > This gets instantiated with a Lucene query, in this cas

Re: Optimizing a boolean query for 100s of term clauses

2020-06-24 Thread Toke Eskildsen
On Tue, 2020-06-23 at 09:50 -0400, Alex K wrote: > I'm working on an Elasticsearch plugin (using Lucene internally) that > allows users to index numerical vectors and run exact and approximate > k-nearest-neighbors similarity queries. Quite a coincidence. I'm looking into the same thing :-) > 1

Re: Optimizing a boolean query for 100s of term clauses

2020-06-24 Thread Michael Sokolov
g. > > I'm using a FunctionScoreQuery from Elasticsearch. > > This gets instantiated with a Lucene query, in this case the boolean query > > as I described it, as well as a custom ScoreFunction object. > > The ScoreFunction exposes a single method that takes a doc id and

Re: Optimizing a boolean query for 100s of term clauses

2020-06-23 Thread Alex K
n 23, 2020 at 3:17 PM Alex K wrote: > Hi Michael, > Thanks for the quick response! > > I will look into the TermInSetQuery. > > My usage of "heap" might've been confusing. > I'm using a FunctionScoreQuery from Elasticsearch. > This gets instantiated with

Re: Optimizing a boolean query for 100s of term clauses

2020-06-23 Thread Alex K
Hi Michael, Thanks for the quick response! I will look into the TermInSetQuery. My usage of "heap" might've been confusing. I'm using a FunctionScoreQuery from Elasticsearch. This gets instantiated with a Lucene query, in this case the boolean query as I described it,

Re: Optimizing a boolean query for 100s of term clauses

2020-06-23 Thread Michael Sokolov
You might consider using a TermInSetQuery in place of a BooleanQuery for the hashes (since they are all in the same field). I don't really understand why you are seeing so much cost in the heap - it's sounds as if you have a single heap with mixed scores - those generated by the BooleanQuery and t

Optimizing a boolean query for 100s of term clauses

2020-06-23 Thread Alex K
Hello all, I'm working on an Elasticsearch plugin (using Lucene internally) that allows users to index numerical vectors and run exact and approximate k-nearest-neighbors similarity queries. I'd like to get some feedback about my usage of BooleanQueries and TermQueries, and see if there are any op

RE: disableCoord is removed in lucene boolean query?

2018-05-21 Thread Uwe Schindler
7 AM > To: Lucene Users > Subject: disableCoord is removed in lucene boolean query? > > I am upgrading my project now, I find there is no disableCoord feature in > boolean query now? > > So now the default behavior is disableCoo

disableCoord is removed in lucene boolean query?

2018-05-21 Thread Yonghui Zhao
I am upgrading my project now, I find there is no disableCoord feature in boolean query now? So now the default behavior is disableCoord = true and not configurable?

Re: Odd Boolean Query behavior in SOLR 3.6

2017-06-13 Thread Erik Hatcher
ems. >> >> In your example, try fq=((*:* -documentTypeId:3) AND companyId:29096) >> >>Erik >> >>> On Jun 13, 2017, at 3:15 AM, abhi Abhishek wrote: >>> >>> Hi Everyone, >>> >>> I have hit a weird behavior o

Re: Odd Boolean Query behavior in SOLR 3.6

2017-06-13 Thread abhi Abhishek
In your example, try fq=((*:* -documentTypeId:3) AND companyId:29096) > > Erik > > > On Jun 13, 2017, at 3:15 AM, abhi Abhishek wrote: > > > > Hi Everyone, > > > >I have hit a weird behavior of Boolean Query, when I am > > running the query w

Re: Odd Boolean Query behavior in SOLR 3.6

2017-06-13 Thread Erik Hatcher
:29096) Erik > On Jun 13, 2017, at 3:15 AM, abhi Abhishek wrote: > > Hi Everyone, > >I have hit a weird behavior of Boolean Query, when I am > running the query with below param’s it’s not behaving as expected. can > you please help me underst

Odd Boolean Query behavior in SOLR 3.6

2017-06-13 Thread abhi Abhishek
Hi Everyone, I have hit a weird behavior of Boolean Query, when I am running the query with below param’s it’s not behaving as expected. can you please help me understand the behavior here? q=*:*&fq=((-documentTypeId:3)+AND+companyId:29096)&version=2.2&start=0&am

Re: boolean query for multiple values on a specific field

2016-01-27 Thread Jack Krupansky
d to a keyword analyzer. > > My problem is that the query parser removes the " characters. It returns > the query tag:(01) value1 tag:value2 which becomes > +(tag:(01) value1 tag:value2) when added to the boolean query and when the > query is executed it becomes +(tag:(UE) defau

boolean query for multiple values on a specific field

2016-01-27 Thread G.Long
keyword analyzer. My problem is that the query parser removes the " characters. It returns the query tag:(01) value1 tag:value2 which becomes +(tag:(01) value1 tag:value2) when added to the boolean query and when the query is executed it becomes +(tag:(UE) default_field:value1 tag:value2) S

RE: Lucene Boolean Query Minimization

2015-02-02 Thread Uwe Schindler
ser@lucene.apache.org; java-user@lucene.apache.org > Subject: AW: Lucene Boolean Query Minimization > > Just an idea: could it be optimized by boolean Algebra? > > Gruss, Ralf > > Gesendet vom Mobiltelefon > ‎ > Originalnachricht > Von: Uwe Schindler > Gesendet: Montag, 2.

AW: Lucene Boolean Query Minimization

2015-02-02 Thread Ralf Heyde
The question here is: is a 'smaller' boolean query consuming less ressources?  Gruss, Ralf Gesendet vom Mobiltelefon ‎   Originalnachricht   Von: Ralf Heyde Gesendet: Montag, 2. Februar 2015 16:28 An: java-user@lucene.apache.org; java-user@lucene.apache.org Antwort an:

AW: Lucene Boolean Query Minimization

2015-02-02 Thread Ralf Heyde
Just an idea: could it be optimized by boolean Algebra? Gruss, Ralf Gesendet vom Mobiltelefon ‎   Originalnachricht   Von: Uwe Schindler Gesendet: Montag, 2. Februar 2015 16:25 An: java-user@lucene.apache.org Antwort an: java-user@lucene.apache.org Betreff: RE: Lucene Boolean Query Minimization

RE: Lucene Boolean Query Minimization

2015-02-02 Thread Uwe Schindler
Hi, You don't give an example of the type of Boolean query you want to "minimize". I have no idea "how" it could be optimized without that information. If a Boolean query contains only one clause, it is rewritten automatically to be the query of its single clause (wit

Lucene Boolean Query Minimization

2015-02-02 Thread Apurv Verma
Hey all, I have a large boolean query in lucene which can be minimized to a smaller version with fewer clauses. Does Lucene automatically minimize complex boolean queries to simpler versions before executing them? If not, are there are predefined ways to do so? -- Regards, Apurv

Re: (DocIds satisfying a query) -> (branch of the boolean query as a tree)

2014-01-25 Thread Michael Sokolov
The highlighters are the only thing I know of (in trunk) that do something like that. Work on this branch (https://issues.apache.org/jira/browse/LUCENE/fixforversion/12317158) is an attempt to make that more efficient. In general the problem with doing this during scoring (the filtering doc

(DocIds satisfying a query) -> (branch of the boolean query as a tree)

2014-01-24 Thread Olivier Binda
Hello While searching a query, I guess that Lucene traverses a Field->Term->DocId structure, filters the docIds that satisfy the query, score them and then sort them Given a resulting docId, I would like a way to find at least a valid path (or the first valid path or all valid paths) that ma

RE: docFreq of a Boolean query (LUCENE 4.3)

2013-12-17 Thread Allison, Timothy B.
olean query (LUCENE 4.3) Hi I know how to get the docFreq of a term in a single field (say "content" field) int docFreqInIndex = indexReader.docFreq(new Term("content", q)); But is it possible to get the docFreq of a boolean query consisting of matches across two or

docFreq of a Boolean query (LUCENE 4.3)

2013-12-16 Thread Peyman Faratin
Hi I know how to get the docFreq of a term in a single field (say "content" field) int docFreqInIndex = indexReader.docFreq(new Term("content", q)); But is it possible to get the docFreq of a boolean query consisting of matches across two or more fields? For inst

Re: Query type always Boolean Query even if * and ? are present.

2013-09-12 Thread Jack Krupansky
x27;t want, then you need to escape it. -- Jack Krupansky -Original Message- From: Ankit Murarka Sent: Thursday, September 12, 2013 11:36 AM To: java-user@lucene.apache.org Subject: Re: Query type always Boolean Query even if * and ? are present. BingoThis has solved my case... Thanks

Re: Query type always Boolean Query even if * and ? are present.

2013-09-12 Thread Jack Krupansky
AM To: java-user@lucene.apache.org Subject: Re: Query type always Boolean Query even if * and ? are present. If I remove the escape call from the function, then it works as expected.. Prefix/Boolean/Wildcard.. But this is NOT what I want... The escape should be present else I will get lexical err

Re: Query type always Boolean Query even if * and ? are present.

2013-09-12 Thread Jack Krupansky
Boolean Query even if * and ? are present. Hello. I am faced with a trivial issue: Everytime my Query is being fired as a Boolean Query... Providing Input : \* This input is provided. Since this contains special characters I use escape method of QueryParser (removed escaping for * and ? since

Re: Query type always Boolean Query even if * and ? are present.

2013-09-12 Thread Ankit Murarka
BingoThis has solved my case... Thanks a ton..!! Does this mean any input containing spaces and query being parsed using QueryParser will result in Query type as Boolean Query UNLESS white space is escaped.. So if the input contains white space and parsed using QueryParser it will

Re: Query type always Boolean Query even if * and ? are present.

2013-09-12 Thread Ankit Murarka
I also tried it with this query: * I am still getting it as Boolean Query.. It should be Prefix... On 9/12/2013 8:50 PM, Jack Krupansky wrote: The trailing asterisk in your query input is escaped with a backslash, so the query parser will not treat it as a wildcard. -- Jack Krupansky

Re: Query type always Boolean Query even if * and ? are present.

2013-09-12 Thread Ankit Murarka
needed.. TIA.. On 9/12/2013 8:52 PM, Ankit Murarka wrote: I also tried it with this query: * I am still getting it as Boolean Query.. It should be Prefix... On 9/12/2013 8:50 PM, Jack Krupansky wrote: The trailing asterisk in your query input is escaped with a backslash, so the query parser

Query type always Boolean Query even if * and ? are present.

2013-09-12 Thread Ankit Murarka
Hello. I am faced with a trivial issue: Everytime my Query is being fired as a Boolean Query... Providing Input : \* This input is provided. Since this contains special characters I use escape method of QueryParser (removed escaping for * and ? since they are needed for WildCard and Prefix

Re: Boolean Query when indexing each line as a document.

2013-08-21 Thread Ankit Murarka
Hello. My main aim is following: a. Index both on line and doc basis (Line basis for providing phrase suggestions/infix suggestions. Doc basis for Firing booleanquery/wildcard query etc.) b. Yeah for boolean/wildcard etc user input will be "xxx" and "yyy" and I will show document name. c. W

Re: Boolean Query when indexing each line as a document.

2013-08-21 Thread Roberto Ragusa
On 08/21/2013 09:51 AM, Ankit Murarka wrote: > Yeah..I eventually DID THIS > > Just a small question : Knowing that BooleanQuery/PrefixQuery/WildCardQuery > might also run fine even if I index the complete document as opposed to doing > it Line by Line. Shouldn't I do it this way rather tha

Re: Boolean Query when indexing each line as a document.

2013-08-21 Thread Ankit Murarka
Yeah..I eventually DID THIS Just a small question : Knowing that BooleanQuery/PrefixQuery/WildCardQuery might also run fine even if I index the complete document as opposed to doing it Line by Line. Shouldn't I do it this way rather than indexing each line for Boolean/Prefix/Wildcard als

Re: Boolean Query when indexing each line as a document.

2013-08-21 Thread Roberto Ragusa
On 08/21/2013 08:38 AM, Ankit Murarka wrote: > Hello. > I tried with > > doc.add(new Field("contents",line,Field.Store.YES,Field.Index.ANALYZED)); > > The BooleanQuery/PrefixMatch/WildCard all started Running fine.. > > But it broke the Existing code for Phrase Suggestion/InfixSuggester. Now >

Re: Boolean Query when indexing each line as a document.

2013-08-20 Thread Ankit Murarka
Hello. I tried with doc.add(new Field("contents",line,Field.Store.YES,Field.Index.ANALYZED)); The BooleanQuery/PrefixMatch/WildCard all started Running fine.. But it broke the Existing code for Phrase Suggestion/InfixSuggester. Now these suggesters are returning Word suggestion instead of Phr

Re: Boolean Query when indexing each line as a document.

2013-08-19 Thread Roberto Ragusa
On 08/19/2013 08:17 AM, Ankit Murarka wrote: > doc.add(new StringField("contents",line,Field.Store.YES)); Did you try with: doc.add(new Field("contents",line,Field.Store.YES)); ? -- Roberto Ragusamail at robertoragusa.it

Re: Boolean Query when indexing each line as a document.

2013-08-18 Thread Ankit Murarka
printStackTrace(); } } public static void displayQuery(Query query) { System.out.println("Query: " + query.toString()); } } I would like to mention the problem once again: Parsing each document line by line to build up indexes and then firing a Boolean query i

Re: Boolean Query when indexing each line as a document.

2013-08-17 Thread Ankit Murarka
llows: I have a document containing information in lines. So I am indexing all files line by line. So If I say in my document I have, INSIDE POST OF SERVER\ and in my index file created I have, INSIDE POST OF SERVER\ and I fire a boolean query with INSIDE and POST wit

Re: Boolean Query when indexing each line as a document.

2013-08-14 Thread Ian Lea
as been indexed? >> >> >> -- >> Ian. >> >> >> On Wed, Aug 14, 2013 at 3:29 PM, Ankit Murarka >> wrote: >> >>> >>> Hello. The problem is as follows: >>> >>> I have a document containing information in lin

Re: Boolean Query when indexing each line as a document.

2013-08-14 Thread Ankit Murarka
ave a document containing information in lines. So I am indexing all files line by line. So If I say in my document I have, INSIDE POST OF SERVER\ and in my index file created I have, INSIDE POST OF SERVER\ and I fire a boolean query with INSIDE and POST with MUST/MUST,

Re: Boolean Query when indexing each line as a document.

2013-08-14 Thread Ian Lea
in my index file created I have, > INSIDE POST OF SERVER\ > > and I fire a boolean query with INSIDE and POST with MUST/MUST, I am getting > no HIT. > > I am providing the complete CODE I am using to create INDEX and TO > SEARCH..Both are drawn from sample code p

Re: Boolean Query when indexing each line as a document.

2013-08-14 Thread Ankit Murarka
3 7:43 PM, Ian Lea wrote: Well, you have supplied a bit more info - good - but I still can't spot the problem. Unless someone else can I suggest you post a very small self-contained program that demonstrates the problem. -- Ian. On Wed, Aug 14, 2013 at 2:50 PM, Ankit Murarka wrote: Hello.

Re: Boolean Query when indexing each line as a document.

2013-08-14 Thread Ian Lea
ntents:INSIDE contents:POST */ --/The field name > is contents. Same analyzer is being used. This is a boolean query./ > > To test, I indexed only 20 files. In 19 files, this is present. > > The boolean query should give me a hit for this document. > > BUT IT IS RET

Re: Boolean Query when indexing each line as a document.

2013-08-14 Thread Ankit Murarka
ield name is contents. Same analyzer is being used. This is a boolean query./ To test, I indexed only 20 files. In 19 files, this is present. The boolean query should give me a hit for this document. BUT IT IS RETURNING ME NO HIT.. If I index the same files WITHOUT line by line then, it gives

Re: Boolean Query when indexing each line as a document.

2013-08-13 Thread Ian Lea
query on this line. It suggest me the > possible values. No problem,. > 3. If I fire a Boolean Query with "remedialaction" and "Checking" as a > must/must , then it is not providing me this document as a hit. > 4. I am using StandardAnalyzer both during the indexing an

Re: Boolean Query when indexing each line as a document.

2013-08-13 Thread Ankit Murarka
If I fire a Boolean Query with "remedialaction" and "Checking" as a must/must , then it is not providing me this document as a hit. 4. I am using StandardAnalyzer both during the indexing and searching time. On 8/13/2013 2:31 PM, Ian Lea wrote: Should be straightforward eno

Re: Boolean Query when indexing each line as a document.

2013-08-13 Thread Ian Lea
n Tue, Aug 13, 2013 at 8:56 AM, Ankit Murarka wrote: > Hello All, >I have 2 different usecases. > I am trying to provide both boolean query and phrase search query in the > application. > > In every line of the document which I am indexing I have content like

Boolean Query when indexing each line as a document.

2013-08-13 Thread Ankit Murarka
Hello All, I have 2 different usecases. I am trying to provide both boolean query and phrase search query in the application. In every line of the document which I am indexing I have content like : \ Due to the phrase search requirement, I am indexing each line of the file as

Re: Boolean Query not working in Lucene 4.0

2013-02-26 Thread Jack Krupansky
:52 PM To: java-user@lucene.apache.org Subject: Boolean Query not working in Lucene 4.0 The following query does not seems to work after we upgrade from 2.4 - 4.0 *+type:sometype +title:sometitle** Any ideas as to what are some of the places to look for? Is the above Query correct in syntax

Boolean Query not working in Lucene 4.0

2013-02-26 Thread saisantoshi
context: http://lucene.472066.n3.nabble.com/Boolean-Query-not-working-in-Lucene-4-0-tp4043246.html Sent from the Lucene - Java Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org

Re: Boolean Query: Knowing Which Clauses Matched

2012-07-18 Thread Ashish Jaen
text analytics and we need the counts for each matched boolean clause for statistics purpose) As a workaround, I create a filter using the original boolean query, cache it, and fire each boolean sub-query subsequently. This has given me a lot of performance gain (these are initial observations, am

Re: Boolean Query: Knowing Which Clauses Matched

2012-07-18 Thread Michael McCandless
all scorers score document-at-a-time) ... would be nice if someone wrote up some example code showing how to do it... Mike McCandless http://blog.mikemccandless.com On Wed, Jul 18, 2012 at 7:17 AM, Ashish Jaen wrote: > Is there a way to know which sub-clause of a boolean query matched in

Re: Filter and query precedence, boolean query

2011-10-23 Thread Josh Devins
I'll reply to the thread with your comment from our IM chat in case it helps anyone else thinking about this. In response to what is preferred, boolean query w/ term queries or a term filter+term query and if order in the boolean query somehow matters: we take care of this internaly no m

Re: Filter and query precedence, boolean query

2011-10-23 Thread Simon Willnauer
hey josh, On Sun, Oct 23, 2011 at 5:39 PM, Josh Devins wrote: > Hi folks, > > I'm hoping someone can shed some light on how filters and boolean queries > work under the hood. As I understand it, the following two queries are > functionally equivalent: > > boolean must, term query: foo, boolean mu

Filter and query precedence, boolean query

2011-10-23 Thread Josh Devins
Hi folks, I'm hoping someone can shed some light on how filters and boolean queries work under the hood. As I understand it, the following two queries are functionally equivalent: boolean must, term query: foo, boolean must, term query: bar term query: foo, term filter: bar What I'd like to unde

multiply sub-scores in boolean query

2011-07-17 Thread Pavel Goncharik
Hi, as far as I can see, boolean scorers always sum up scores of their sub-scorers. It works, but in case of my application it's required to multiply sub-scores. Is there a simple/efficient way to do this (apart from modifying lucene's source code)? It seems to me that standard tricks (e.g. Custom

Re: lucene3.0.3 | get correct document in case of multiple Boolean query in search criteria

2011-02-22 Thread Ranjit Kumar
Hi, As, mention above i am using query like: criteria = (sql OR sqlserver OR "sql server") AND java AND delphi In the above scenario i need hit(document) containing at least one occurrence of (sql OR sqlserver OR "sql server"). Also java and delphi must present in document. Still I have not g

Re: lucene3.0.3 | get correct document in case of multiple Boolean query in search criteria

2011-02-21 Thread Ranjit Kumar
Hi Ian; As you told we can use explicitly specify ANDs and ORs operator set parser. Otherwise we can use default parser to get hit(document) which is ORs. Do not gives correct hit(document)!!! My question is that, Is there any parser we can use in case of multiple Boolean clause in search stri

Re: lucene3.0.3 | get correct document in case of multiple Boolean query in search criteria

2011-02-18 Thread Ian Lea
; in code below: > > QueryParser parser = new QueryParser(Version.LUCENE_CURRENT, field, > analyzer); parser.setDefaultOperator(QueryParser.OR_OPERATOR); > > Query query = parser.parse(criteria); > > which is not correct. please! suggest me feasible solution. > > how could get correct docu

lucene3.0.3 | get correct document in case of multiple Boolean query in search criteria

2011-02-18 Thread Ranjit Kumar
suggest me feasible solution. how could get correct document in case of multiple Boolean query in search criteria? Thanks & Regards, Ranjit Kumar === Private, Confidential and Privileged. This e-mail and

Re: Lucene: how to get frequency of Boolean query

2010-12-26 Thread Li Li
p = (ScoreDoc) pq.updateTop(); } Because the scorer in BooleanScorer2 is ConjuctionScorer(DisjuctionScorer). it can not get tf. If you want to do this. you have to modify many codes 2010/12/25 Ranjit Kumar > Hi, > > Merry Christmas!! > > > > In case of Boolean query like *

Lucene: how to get frequency of Boolean query

2010-12-25 Thread Ranjit Kumar
Hi, Merry Christmas!! In case of Boolean query like 'sql AND server' . I am using parser to get correct document containing both sql and server. Inside for loop in below code I get correct documented and to get frequency I need to sum frequency of 'sql' and 'serv

RE: Unexpected Results - using should and must in boolean query

2010-09-17 Thread Uwe Schindler
e.apache.org > Subject: RE: Unexpected Results - using should and must in boolean query > > > : If you have some MUST terms, but you also want to have at least one of a > : list of other terms (like 5 SHOULD clauses), the trick is to separate both: > : Create a BooleanQuery wi

RE: Unexpected Results - using should and must in boolean query

2010-09-17 Thread Chris Hostetter
: If you have some MUST terms, but you also want to have at least one of a : list of other terms (like 5 SHOULD clauses), the trick is to separate both: : Create a BooleanQuery with 2 MUST clauses, one is your required TermQuery : and the second clause is itself a BooleanQuery with all the SHOULD

Re: Unexpected Results - using should and must in boolean query

2010-09-12 Thread liat oren
--- > Uwe Schindler > H.-H.-Meier-Allee 63, D-28213 Bremen > http://www.thetaphi.de > eMail: u...@thetaphi.de > > > > -Original Message- > > From: liat oren [mailto:oren.l...@gmail.com] > > Sent: Sunday, September 12, 2010 2:04 PM > > To: java-user@l

RE: Unexpected Results - using should and must in boolean query

2010-09-12 Thread Uwe Schindler
bject: Unexpected Results - using should and must in boolean query > > Hi, > > I am running a query and get some unexpected results. > > When I run boolean query on a text field for the word X, using occur = SHOULD, > the results contain the word X. > > However, when I add

Re: Unexpected Results - using should and must in boolean query

2010-09-12 Thread Erick Erickson
unning a query and get some unexpected results. > > When I run boolean query on a text field for the word X, using occur = > SHOULD, the results contain the word X. > > However, when I add another boolean query on another field (country) for > the > word Y, using occur = MUST, in

Unexpected Results - using should and must in boolean query

2010-09-12 Thread liat oren
Hi, I am running a query and get some unexpected results. When I run boolean query on a text field for the word X, using occur = SHOULD, the results contain the word X. However, when I add another boolean query on another field (country) for the word Y, using occur = MUST, in the results I get

Re: subset query :query filter or boolean query

2010-07-15 Thread Ian Lea
> 7-P3 > > .. > > .. > > when i search > docs with P2 I get 3,4,5 > > Now I want my search to b restricted to just > 3,4,5 doc only. where by I can search only these docs for further > parameters. > > 1. How to go abt it. Boolean query with multiple nested quer

subset query :query filter or boolean query

2010-07-14 Thread suman.holani
Hi , I have 4 query search fields. case 1 : if i use one search field to make a query filter and then use the query filter to search on other 3 fields so as to reduce the searching docs subset. case 2: i use all query parameters using boolean query , whole of index will be searched

RE: confused by the lucene boolean query with wildcard result

2010-02-03 Thread java8964 java8964
Thanks for you help. I upgrade the lucene to 2.9.1, the problem is gone. It looks like a boolean query bug in the lucene 2.9.0 and fixed in the 2.9.1 Thanks > From: ian@gmail.com > Date: Wed, 3 Feb 2010 10:02:27 + > Subject: Re: confused by the lucene boolean query with

Re: confused by the lucene boolean query with wildcard result

2010-02-03 Thread Ian Lea
You should probably be using your PerFieldAnalyzerWrapper in your calls to QueryParser but apart from that I can't see any obvious reason. General advice: use Luke to check what has been indexed and read http://wiki.apache.org/lucene-java/LuceneFAQ#Why_am_I_getting_no_hits_.2BAC8_incorrect_hits.3

confused by the lucene boolean query with wildcard result

2010-02-02 Thread java8964 java8964
Hi, I have the following test case point to the index generated in our application. The result is confusing me and I don't know the reason. Lucene version: 2.9.0 JDK 1.6.0_18 public class IndexTest1 { public static void main(String[] args) { try { FSDirectory directory =

Re: how to deal with too many clause error in boolean query.

2009-06-18 Thread Michael McCandless
On Wed, Jun 17, 2009 at 3:32 PM, Tim Williams wrote: > On Wed, Jun 17, 2009 at 3:16 PM, vanshi wrote: >> >> Hello all, >> >> I have a situation where a field is indexed like this >> (FAC_NAME(Field.Store.NO, Field.Index.NO_NORMS)) and keyword analyzer is >> used on this field. Although, I'm aware t

Re: how to deal with too many clause error in boolean query.

2009-06-17 Thread Tim Williams
On Wed, Jun 17, 2009 at 3:16 PM, vanshi wrote: > > Hello all, > > I have a situation where a field is indexed like this > (FAC_NAME(Field.Store.NO, Field.Index.NO_NORMS)) and keyword analyzer is > used on this field. Although, I'm aware that NO_NORMS doesn't use any > analyzer. > > Now, the query +

how to deal with too many clause error in boolean query.

2009-06-17 Thread vanshi
; field?? -- View this message in context: http://www.nabble.com/how-to-deal-with-too-many-clause-error-in-boolean-query.-tp24080152p24080152.html Sent from the Lucene - Java Users mailing list archive at Nabble.com. - To unsu

Boolean query ...

2009-03-19 Thread Dragon Fly
Let's say I have 3 fields in a document (Type, FirstName, and LastName). For example: Document 0 -- Type: Public FirstName: John LastName: Deere If I execute the following boolean query, document 0 is returned. Type:Public OR FirstName:Candy OR LastName:

Re: boolean query or

2008-07-09 Thread Karl Wettin
9 jul 2008 kl. 07.37 skrev Cam Bazz: Hello, Is it possible to make a boolean query where a word is equal to fieldA or fieldB? in other words, I like to search a word in two fields, if word passes in fieldA or fieldB, then it is a hit. XOR? +(A B) -(+A +B) karl

boolean query or

2008-07-08 Thread Cam Bazz
Hello, Is it possible to make a boolean query where a word is equal to fieldA or fieldB? in other words, I like to search a word in two fields, if word passes in fieldA or fieldB, then it is a hit. Best, -C.B.

Re: Boolean Query Issue

2008-06-02 Thread Sonu Sudhakar
t OR TTL:store => 1,496 results >> > > 3. TTL:variable AND TTL:computer OR TTL:device => 1,496 results >> > > >> > > I hope you have a clearer picture of my issue now. >> > > >> > > Thanks, >> > > Sonu >> &g

Re: Boolean Query Issue

2008-06-02 Thread Sonu Sudhakar
now. > > > > > > Thanks, > > > Sonu > > > > > > > > > On Wed, May 28, 2008 at 7:09 PM, Erick Erickson < > [EMAIL PROTECTED] > > > > > > wrote: > > > > > >> It's unclear what you *should* expect. How

Re: Boolean Query Issue

2008-06-02 Thread Erick Erickson
y documents do you have? In this example, > >> for instance, > >> 1. TTL:data AND TTL:store OR TTL:variable => 3,733 results > >> it considered the TTL:data part only. > >> > >> it's perfecily reasonable if every document that had "variable&quo

Re: Boolean Query Issue

2008-06-01 Thread Sonu Sudhakar
considered the TTL:data part only. >> >> it's perfecily reasonable if every document that had "variable" in the >> field *also* has "data" and "store" in the field. So your numbers >> don't give us much to work with. >> >&

Re: Boolean Query Issue

2008-05-29 Thread Sonu Sudhakar
7;t give us much to work with. > > Remember, though, that Lucene syntax isn't a pure boolean syntax. See > > http://wiki.apache.org/lucene-java/BooleanQuerySyntax > > And when in doubt parenthesize ... > > Best > Erick > > On Wed, May 28, 2008 at 7:44 AM, Sonu S

Re: Boolean Query Issue

2008-05-28 Thread Erick Erickson
x And when in doubt parenthesize ... Best Erick On Wed, May 28, 2008 at 7:44 AM, Sonu Sudhakar <[EMAIL PROTECTED]> wrote: > Hi, > > I have some issue with boolean queries. > > I am using Lucene-core-2.3.1. > > I have done test on boolean query with 3 terms (data, s

Boolean Query Issue

2008-05-28 Thread Sonu Sudhakar
Hi, I have some issue with boolean queries. I am using Lucene-core-2.3.1. I have done test on boolean query with 3 terms (data, store, variable) in my TTL field. The TTL field is indexed and searched using StandardAnalyzer. The three terms when searched individually gave the following result

Re: Is there a way to speed up boolean query if I don't care about score?

2008-03-28 Thread Erick Erickson
What about ConstantScoreQuery? Erick On Wed, Mar 26, 2008 at 2:34 PM, Wojtek H <[EMAIL PROTECTED]> wrote: > Hi all, > > Suppose my query has "normal" part for which I want score as usual and > other part which is big disjunction (OR) query for which I just want > documents to match and don't car

Is there a way to speed up boolean query if I don't care about score?

2008-03-26 Thread Wojtek H
Hi all, Suppose my query has "normal" part for which I want score as usual and other part which is big disjunction (OR) query for which I just want documents to match and don't care about scoring. Is there a way to make it fast? As far as I understand if 'no-score' part was the same in many querie

RE: Boolean Query search performance

2008-03-10 Thread Beard, Brian
Message- From: Chris Hostetter [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2008 3:23 PM To: java-user@lucene.apache.org Subject: Re: Boolean Query search performance : > additional parens normally indicates that you are actually creating an : > extra layer of BooleanQueries

Re: Boolean Query search performance

2008-03-07 Thread Chris Hostetter
: > additional parens normally indicates that you are actually creating an : > extra layer of BooleanQueries (ie: a BooleanQuery with only one clause for : look here, : parens will also be add is each term has a boost value larger than 1.0. i think you are missreading that code. the "needParens

RE: Boolean Query search performance

2008-03-06 Thread Beard, Brian
Thanks for all replies. Today when I printed out the query that's generated it does not have the extra paren's. And query.rewrite(reader).toString() now gives the same result as query.toString(). All I can figure is I must have changed something between starting the email and sending it out. The o

  1   2   >