BooleanQuery

2006-09-29 Thread Ismail Siddiqui
Hi, I have two pharase queries messageQuery = new PhraseQuery(); titleQuery = new PhraseQuery(); messageQuery.setSlop(3); titleQuery.setSlop(1); for (int i=0; i

BooleanQuery

2006-12-06 Thread Marcelo Ohashi
Hi, Does anyone know if lucene can handle complex boolean queries like the following ones? 1. T: (A OR NOT B) 2. (T:A AND NOT T:B) OR NOT T:C Cause I figured out in some tests that the results were not really what I expected. Thanks in advance, _ Marcelo Ohashi

BooleanQuery

2005-11-01 Thread tcorbet
I have an index over the titles to .mp3 songs. It is not unreasonable for the user to want to see the results from: "Show me Everything". I understand that title:* is not a valid wildcard query. I understand that title:[a* TO z*] is a valid wildcard query. What I cannot understand is this behavi

BooleanQuery

2006-06-21 Thread WATHELET Thomas
Why I retrive hits with this query : +doccontent:avian +doctype:AM +docdate:[2005033122000 TO 2006062022000] and not with this one +doccontent:avian influenza +doctype:AM +docdate:[2005033122000 TO 2006062022000]

BooleanQuery$TooManyClauses

2005-07-10 Thread [EMAIL PROTECTED]
Did a google serach on the problem when using the range search phrase of "+datefield:[199801 TO 200512]" (date stored as "MMDD") which returns 1 million hits. error: org.apache.lucene.search.BooleanQuery$TooManyClauses Adding "-Dorg.apache.lucene.maxClauseCount=2400" to java option allowe

BooleanQuery inquiry

2009-03-16 Thread Jay Joel Malaluan
Hi, Need some expert opinion on the following. Lucene 2.3.2 Scenario on searching: 3 Fields - EXACT, KEYWORD, STEM_KEYWORD EXACT,KEYWORD - uses KeywordAnalyzer STEM_KEYWORD - uses SnowballAnalyzer(English) Searching for each field has it's own queries. I'm using a BooleanQuery to m

BooleanQuery questions

2007-10-03 Thread Warren
I am new to Lucene and am having problems with booleanQueries. How do you write Boolean OR and AND queries? Is this an OR query booleanQuery.add(query1, BooleanClause.Occur.SHOULD); booleanQuery.add(query2, BooleanClause.Occur.SHOULD); and is this an AND query booleanQuery.add(query1, Boolean

BooleanQuery Example

2008-06-02 Thread Aamir.Yaseen
Hi, I am new to Lucene, so asking some basic question. Is there any example/reference implementation available of Lucene Usage using BooleanQuery using API instead of QueryParser? Cheers Aamir Yaseen This e-mail is confidential and should not be used by anyone who is not the

Custom BooleanQuery

2008-06-16 Thread Sascha Fahl
Hi, I'm trying to build my own query. I want to combine several TermQuery + 1 PrefixQuery in a BooleanQuery. The Code looks like this: BooleanQuery bq = new BooleanQuery(); Term t = new Term("field", ""); t.createTerm("foo"); TermQuery tq = new

Re: BooleanQuery

2006-09-29 Thread Find Me
For: BooleanQuery bQuery=new BooleanQuery(); bQuery.add(messageQuery,true,false) Use: BooleanQuery bQuery=new BooleanQuery(); bQuery.add(messageQuery, BooleanClause.Occur.MUST); Mapping is as follows: For add(query, true, false) use add(query, BooleanClause.Occur.MUST) For add(query, false

Re: BooleanQuery

2006-12-06 Thread Erick Erickson
These are not boolean operators, which is often confusing. See the thread "*Another problem with the QueryParser*" for an exposition by Chris about how these operate. This may change what you expect to come back from the parser... If it doesn't, then maybe someone else can chime in ... Erick O

RE: BooleanQuery

2006-12-06 Thread Renaud Waldura
k Erickson [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 06, 2006 11:56 AM To: java-user@lucene.apache.org Subject: Re: BooleanQuery These are not boolean operators, which is often confusing. See the thread "*Another problem with the QueryParser*" for an exposition by Chris about

Re: BooleanQuery

2006-12-07 Thread Marcelo Ohashi
rick, the stock QP doesn't quite do what one (legitimately IMO) expects. --Renaud -Original Message- From: Erick Erickson [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 06, 2006 11:56 AM To: java-user@lucene.apache.org Subject: Re: BooleanQuery These are not boolean operators, w

Re: BooleanQuery

2005-11-01 Thread Erik Hatcher
On 1 Nov 2005, at 01:43, tcorbet wrote: I have an index over the titles to .mp3 songs. It is not unreasonable for the user to want to see the results from: "Show me Everything". I understand that title:* is not a valid wildcard query. I understand that title:[a* TO z*] is a valid wildcard query

Re: BooleanQuery

2005-11-01 Thread Michael D. Curtin
tcorbet wrote: I have an index over the titles to .mp3 songs. It is not unreasonable for the user to want to see the results from: "Show me Everything". I understand that title:* is not a valid wildcard query. I understand that title:[a* TO z*] is a valid wildcard query. What I cannot underst

Re: BooleanQuery

2005-11-01 Thread Erik Hatcher
On 1 Nov 2005, at 08:17, Michael D. Curtin wrote: tcorbet wrote: I have an index over the titles to .mp3 songs. It is not unreasonable for the user to want to see the results from: "Show me Everything". I understand that title:* is not a valid wildcard query. I understand that title:[a* TO z

BooleanQuery$TooManyClauses

2006-04-19 Thread Flávio Marim
Hi there. I am a new Lucene user and I have been searching the group archives but couldn't solve the problem. I have just joined a project that uses Lucene. We get an error when we issue some of our wildcard text searches. We use the StandardAnalyzer for indexing our documents and our query is a

RE: BooleanQuery

2006-06-21 Thread Mile Rosu
: java-user@lucene.apache.org Subject: BooleanQuery Why I retrive hits with this query : +doccontent:avian +doctype:AM +docdate:[2005033122000 TO 2006062022000] and not with this one +doccontent:avian influenza +doctype:AM +docdate:[2005033122000 TO 2006062022000

RE: BooleanQuery

2006-06-21 Thread Gustavo Comba
ginal- De: WATHELET Thomas [mailto:[EMAIL PROTECTED] Enviado el: miércoles, 21 de junio de 2006 15:40 Para: java-user@lucene.apache.org Asunto: BooleanQuery Why I retrive hits with this query : +doccontent:avian +doctype:AM +docdate:[2005033122000 TO 2006062022000] and not with thi

RE: BooleanQuery

2006-06-21 Thread WATHELET Thomas
Ok thanks a lot. Before I use TermQuery for the filed doccotent now I use Query object with QueryParser.parse and it's work perfectly. -Original Message- From: Gustavo Comba [mailto:[EMAIL PROTECTED] Sent: 21 June 2006 16:00 To: java-user@lucene.apache.org Subject: RE: Boolean

BooleanQuery question

2006-07-06 Thread Van Nguyen
I have a BooleanQuery that looks like this: BooleanQuery query = new BooleanQuery(); TermQuery term1 = new TermQuery(new Term(ID, "1234")); TermQuery term2 = new TermQuery(new Term(ID, "2344")); TermQuery term2 = new TermQuery(new Term(ID, "2323"));

BooleanQuery question

2006-07-19 Thread Nicolas Labrot
Hi, I have made a simple class that parse an XML boolean expression to create predefined query . Here is an unroll construction from an xml topic which reduce the search on path "/bssrs" and exclude the file "abstract.htm" : subsubTermQuery1 = new TermQuery(new Term("FILE", "abstract

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

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

TooManyClauses in BooleanQuery

2005-06-13 Thread Harald Stowasser
the sorting is so slow, I want to allow the user specifying a Date-Range. But Lucene throws an BooleanQuery$TooManyClauses[2]. Anywhere I read if you give lucene a higher MaxClauseCount, this will solve that Problem. But it doesn't work :-( 3. I also read that we should save the Date as YYY

Re: BooleanQuery$TooManyClauses

2005-07-11 Thread Erik Hatcher
queries? How does one estimate the number of clauses required for a general query and more specifically on a range query? RangeQuery expands under the covers to a BooleanQuery with all matching terms OR'd together. In your case, if you've indexed a term for every day in that rang

Re: BooleanQuery$TooManyClauses

2005-07-11 Thread [EMAIL PROTECTED]
ange query? RangeQuery expands under the covers to a BooleanQuery with all matching terms OR'd together. In your case, if you've indexed a term for every day in that range using MMDD then you've got 2,524 terms roughly = 7 * 365 - 31 (minus 31 because you'd omit Dec

BooleanQuery Performance Help

2008-12-20 Thread Prafulla Kiran
Hi Everyone, I have an index of relatively small size (400mb) , containing roughly 0.7 million documents. The index is actually a copy of an existing database table. Hence, most of my queries are of the form " +field1:value1 +field2:value2 +field3:value3. ~20 fields" I have been running

Re: BooleanQuery questions

2007-10-03 Thread Erick Erickson
I don't see a problem with your booleanANDSearch thingy, although I haven't tried it. Does toString() return the same string regardless of the value of booleanANDSearch? That would surprise me. The default is OR, so the toString output looks like booleanANDSearch is false. In general, the Lucene

Re: BooleanQuery questions

2007-10-03 Thread Warren
Thanks for the reply. Everything is working correctly now. I jumped the gun without debuging it more. booleanANDSearch was not getting set correctly. Erick Erickson wrote: I don't see a problem with your booleanANDSearch thingy, although I haven't tried it. Does toString() return the same stri

RE: BooleanQuery Example

2008-06-03 Thread Aamir.Yaseen
uilding your queries directly with the query API. In other words, the query parser >>is designed for human-entered text, not for program-generated text. Is there any sample implementation of Lucene Implementation of BooleanQuery using API instead of QueryParser? Cheers Aamir Yaseen ---

Re: BooleanQuery Example

2008-06-03 Thread Ian Lea
Hi It's pretty straightforward. Create a BooleanQuery and add other queries to it e.g. BooleanQuery bq = new BooleanQuery(); TermQuery tq = new TermQuery(new Term(k, v)); RangeQuery rq = new RangeQuery(new Term(k1, v0), new Term(k

Re: Custom BooleanQuery

2008-06-16 Thread Erick Erickson
, Occur.MUST); Best Erick On Mon, Jun 16, 2008 at 4:25 AM, Sascha Fahl <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to build my own query. I want to combine several TermQuery + 1 > PrefixQuery in a BooleanQuery. The Code looks like this: > BooleanQuery bq = ne

CustomScoreQuery and BooleanQuery

2008-08-06 Thread Jay
BooleanQuery. BoostingQuery is one such attempt but it's not very flexible (e.g. the damping is independent of the scores of sub queries). Does anyone know any other existing examples similar to CustomScoreQuery but deal with multiple sub queries? Thanks!

QueryParser vs. BooleanQuery

2008-09-04 Thread bogdan71
Hello, I am experiencing a strange behaviour when trying to query the same thing via BooleanQuery vs. via the know-it-all QueryParser class. Precisely, the index contains the document: "12,Visual C++,4.2" with the field layout: ID,name,version(thus, "12" is the ID fi

NumericRangeQuery in BooleanQuery

2010-04-16 Thread Murdoch, Paul
Hi, Can a NumericRangeQuery be one of several Queries inside a complex BooleanQuery? When I do this my NumericRangeQuery seems to automagically be converted to a TermRangeQuery. Thanks, Paul

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

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

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

Problem with BooleanQuery

2011-09-21 Thread Peyman Faratin
Hi The problem I would like to solve is determining the lucene score of a word in _a particular_ given document. The 2 candidates i have been trying are - QueryWrapperFilter - BooleanQuery Both are to restrict search within a search space. But according to Doug Cutting QueryWrapperFilter

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

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

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

BooleanQuery or QueryFilter?

2005-09-09 Thread Jeff Rodenburg
Ids. Should I be looking at BooleanQuery, QueryFilter or a custom filter? QueryFilter (or customfilter, as I may pull the id values from a db) seem like the *best* approach for my scenario. I'm just looking for feedback from others who have gone this route and what their experiences yielded. Thanks, jeff

RangeQuery or BooleanQuery?

2006-02-28 Thread Seeta Somagani
Hi, My documents are in the following format. doc.add(new Field ("id",page, Field.Store.YES, Field.Index.TOKENIZED)); doc.add(new Field ("content",fileContent.toString(), Field.Store.YES, Field.Index.TOKENIZED, Field.TermVector.WITH_POSITIONS_OFFSETS)); I need to make a query on

Re: BooleanQuery$TooManyClauses

2006-04-19 Thread Daniel Naber
On Mittwoch 19 April 2006 22:10, Flávio Marim wrote: > I am a new Lucene user and I have been searching the group archives but > couldn't solve the problem. see http://wiki.apache.org/jakarta-lucene/LuceneFAQ#head-06fafb5d19e786a50fb3dfb8821a6af9f37aa831 -- http://www.danielnaber.de --

Re: BooleanQuery$TooManyClauses

2006-04-20 Thread Supriya Kumar Shyamal
Normally the default setup for BooleanCluase count is 1024, may be your query produce more query than 1024, one work around is that you set the BooleanCluase count to more than 1024. You can do that by just invoking the static method BooleanQuery.setMaxClauseCount(2048); supriya Flávio Marim

Re: BooleanQuery$TooManyClauses

2006-04-24 Thread Flávio Marim
Thanks friends. The problem was solved. I used BooleanQuery.setMaxClauseCount(Integer.MAX_VALUE) because the value was really big and so variable that I couldn't determine a consistent top value. -- Marim Supriya Kumar Shyamal disse: > Normally the default setup for BooleanCluase count is 1024, m

Re: BooleanQuery$TooManyClauses

2006-04-24 Thread Erick Erickson
Be careful, especially if you have some test data that you're using to prove things out and only later will you use the "real" (and usually much larger) data set. There are two problems that I know of with bumping the clauses to MAX_VALUE. 1> you can run out of memory. 2> it might take a long time

Re: BooleanQuery question

2006-07-06 Thread Michael D. Curtin
27;ll need to put the three ID-based TermQuerys into a sub-BooleanQuery instead of the top-level query. Something like this: BooleanQuery subquery = new BooleanQuery(); subquery.add(term1, BooleanClause.Occur.Should); subquery.add(term2, BooleanClause.Occur.Should); subquery.add(

RE: BooleanQuery question

2006-07-10 Thread Van Nguyen
That worked... thanks! -Original Message- From: Michael D. Curtin [mailto:[EMAIL PROTECTED] Sent: Thursday, July 06, 2006 1:04 PM To: java-user@lucene.apache.org Subject: Re: BooleanQuery question Van Nguyen wrote: > I just want results that have: > > ID: 1234 OR 234

Re: BooleanQuery question

2006-07-19 Thread Chris Hostetter
: If I search with boolQuery, Lucene doesn't find anything. : If I modify by hand the query from "+(-(FILE:abstract.htm)) : +(PATH:/bssrs)" to "-(FILE:abstract.htm) +(PATH:/bssrs)", Lucene find : the correct list of document. : : Does somebody know why ? you can't have a boolean query containing

Re: BooleanQuery question

2006-07-19 Thread Nicolas Labrot
In my mind this restriction only apply on a query with just a MUST_NOT clause and not to a composed query. I've wrong. thanks a lot, Nicolas : If I search with boolQuery, Lucene doesn't find anything. : If I modify by hand the query from "+(-(FILE:abstract.htm)) : +(PATH:/bssrs)" to "-(FILE:

Re: BooleanQuery question

2006-07-19 Thread Chris Hostetter
: In my mind this restriction only apply on a query with just a MUST_NOT : clause and not to a composed query. I've wrong. right ... it's an issue for any BooleanQuery, regardless of how that query may be wrapped in other boolean queries.

Re: BooleanQuery question

2006-07-21 Thread Paul Borgermans
Hi you can't have a boolean query containing only MUST_NOT clauses (which is what (-(FILE:abstract.htm)) is. it matches no documents, so the mandatory qualification on it causes the query to fail for all docs. This is true for the search queries, but it makes sense in a query filter IMHO. I e

Re: BooleanQuery question

2006-07-22 Thread Chris Hostetter
- wrapping a QueryFilter arround a BooleanQuery doesn't change any intrinsic rules about how a BooleanQuery works -- it just uses the results in a differnet way. 2) It's trivial to write a Filter that selects all items which do *not* match a Query -- by writting a Filter that flips

Filters or BooleanQuery

2006-07-31 Thread Michael J. Prichard
This is more of a design question. I have a ton of email that is indexed. I need to search based on a date range so I use a RangeQuery added to a BooleanQuery to search. This works. Now I need to include another clause that will narrow the result even more. AND on top of that I will need

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: 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

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-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-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-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-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 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$TooManyClauses::getMessage() == null

2005-05-18 Thread Ernesto De Santis
Hi I catch the TooManyClauses Exception in my application, and when I show the exception message get null value. This behavior is bad I think, don't help to found cause of errors. Now I use e.getClass() + ": " + e.getMessage() in my catch statement. result: org.apache.lucene.search.BooleanQuery$

Re: TooManyClauses in BooleanQuery

2005-06-13 Thread a . herberger
Wiesbaden Andreas M. Herberger mailto: [EMAIL PROTECTED] http://www.makrolog.de Harald Stowasser <[EMAIL PROTECTED]> 13.06.2005 13:47 Please respond to java-user@lucene.apache.org To java-user@lucene.apache.org cc Subject TooManyClauses in BooleanQuery Hello lucene-list readers,

Re: TooManyClauses in BooleanQuery

2005-06-13 Thread Erik Hatcher
On Jun 13, 2005, at 7:47 AM, Harald Stowasser wrote: 1. Sorting by Date is ruinously slow. So I deactivated it. How were you sorting by date? 3. I also read that we should save the Date as MMDD-String. I don't like this solution, because I don't know that this will work. And then I h

Re: TooManyClauses in BooleanQuery

2005-06-13 Thread Harald Stowasser
[EMAIL PROTECTED] schrieb: > Hi Harald, > > its nice too see, that there are others out there in Germany dealing with > the same problems as we have been doing in the past years :-) > > So for the "too many clauses" problem I have a solution for you, that I > want to share: > Just include some

Re: TooManyClauses in BooleanQuery

2005-06-13 Thread Harald Stowasser
Harald Stowasser schrieb: P.S. I tried now to use DateFilter. This works, but is very slow on longer Date-Ranges. (30sec. ) signature.asc Description: OpenPGP digital signature

RE: TooManyClauses in BooleanQuery

2005-06-13 Thread Omar Didi
BooleanQuery [EMAIL PROTECTED] schrieb: > Hi Harald, > > its nice too see, that there are others out there in Germany dealing with > the same problems as we have been doing in the past years :-) > > So for the "too many clauses" problem I have a solution for you, tha

Re: TooManyClauses in BooleanQuery

2005-06-13 Thread Erik Hatcher
On Jun 13, 2005, at 8:44 AM, Harald Stowasser wrote: Harald Stowasser schrieb: P.S. I tried now to use DateFilter. This works, but is very slow on longer Date-Ranges. (30sec. ) Filters in general were meant for one-time creation and caching. If the date ranges are fixed and the index not

Unique results in BooleanQuery

2008-12-16 Thread Jay Malaluan
Hi, Anyone knowledgeable on how to get unique hits using the BooleanQuery? If I have 2 queries so the when the 1st query is processed then the 2nd query will not anymore return the same results from the 1st query. Regards, Jay Malaluan -- View this message in context: http://www.nabble.com

Re: BooleanQuery Performance Help

2008-12-20 Thread Paul Elschot
Op Saturday 20 December 2008 15:23:43 schreef Prafulla Kiran: > Hi Everyone, > > I have an index of relatively small size (400mb) , containing roughly > 0.7 million documents. The index is actually a copy of an existing > database table. Hence, most of my queries are of the form > > " +field1:value

Re: BooleanQuery Performance Help

2008-12-20 Thread Erick Erickson
What specifically are you measuring when you time the queries? I've been mislead by including in my measurement say, creating the response. I realize that throughput includes assembling the response, but the solution is different depending upon whether it's the actual search or what you do with the

Re: BooleanQuery Performance Help

2008-12-21 Thread Prafulla Kiran
Hi, Here's the code which I am using to time the query: long startTime = System.currentTimeMillis(); TopDocCollector collector = new TopDocCollector(10); is.search(query,collector); ScoreDoc[] hits = collector.topDocs().scoreDocs; long endTime = System.currentTimeMillis(); Most of the clauses w

Re: BooleanQuery Performance Help

2008-12-22 Thread Erick Erickson
Well, you haven't run afoul of the usual suspects, that's pretty clean timing code. I'm afraid I'll have to defer to the people who know the internals of Lucene. Best Erick On Sun, Dec 21, 2008 at 10:31 PM, Prafulla Kiran wrote: > Hi, > > Here's the code which I am using to time the query: >

Alternative scoring of BooleanQuery

2009-07-07 Thread Klaus Malorny
for the same term within each field, combining it via a BooleanQuery/Occur.SHOULD. If a term happens to appear in both fields, the score is added (and scaled, if disableCoord is false). In my context this is not really what I want. I would prefer to have a simple "maximum" functio

Re: CustomScoreQuery and BooleanQuery

2008-08-07 Thread Doron Cohen
ueries in a way different from the > BooleanQuery. BoostingQuery is one such attempt but it's not very flexible > (e.g. the damping is independent of the scores of sub queries). > Does anyone know any other existing examples similar to CustomScoreQuery > but deal with multiple sub queries? > > Thanks! > > Jay >

Re: QueryParser vs. BooleanQuery

2008-09-04 Thread Ian Lea
wrote: > > Hello, > > I am experiencing a strange behaviour when trying to query the same thing > via > BooleanQuery vs. via the know-it-all QueryParser class. Precisely, the index > contains > the document: > "12,Visual C++,4.2" with the field layout: I

Re: QueryParser vs. BooleanQuery

2008-09-04 Thread 叶双明
Indeed, StandardAnalyzer removing the pluses, so analyse 'c++' to 'c'. QueryParser include Term that been analysed. And BooleanQuery include Term that hasn't been analysed. I think this is the difference between they. 2008/9/4 Ian Lea <[EMAIL PROTECTED]> > Hav

Lucene 2.9.0 / BooleanQuery problem

2009-10-28 Thread Michel Nadeau
Hi ! I spent all night trying to get a simple BooleanQuery working and I really can't figure out what is my problem. See this very simple program : public class test { @SuppressWarnings("deprecation") public static void main(String[] args) throws ParseException, Corrup

RE: NumericRangeQuery in BooleanQuery

2010-04-16 Thread Uwe Schindler
-28213 Bremen http://www.thetaphi.de eMail: u...@thetaphi.de > -Original Message- > From: Murdoch, Paul [mailto:paul.b.murd...@saic.com] > Sent: Friday, April 16, 2010 8:11 PM > To: java-user@lucene.apache.org > Subject: NumericRangeQuery in BooleanQuery > >

RE: NumericRangeQuery in BooleanQuery

2010-04-19 Thread Murdoch, Paul
Yes and no. I extended the QueryParser and overrode the getRangeQuery method to let it build NRQ. When parsing a BooleanQuery containing NRQ using the extended QueryParser the overridden getRangeQuery was never being called. I think it was still using the QueryParser's. In the en

Strange Behaviour of BooleanQuery?

2007-02-08 Thread Oliver Hummel
Hi @all, I'm a little confused about the behaviour of BooleanQuery. I have a custom parser that analyzes some text and constrcuts an "ANDed" BooleanQuery. toString delivers something like this: (+field1:term1 +field2:term2) Looks pretty normal to me, but the problem is it deli

Optional terms in BooleanQuery

2007-05-20 Thread Peter Bloem
at have both A and B, and ranks them higher if they also have C D or E. I'm wondering how this translates to a BooleanQuery. I know I should use BooleanClause.Occur.MUST for A and B, and I guess I should use BooleanQuery.Occur.SHOULD for C, D and E. However the javadocs for BooleanClause

Mixing SpanQuery and BooleanQuery

2007-08-06 Thread Peter Keegan
I'm trying to create a fairly complex SpanQuery from a binary parse tree. I create SpanOrQueries from SpanTermQueries and combine SpanOrQueries into BooleanQueries. So far, so good. The problem is that I don't see how to create a SpanNotQuery from a BooleanQuery and a SpanTermQuery.

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

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: 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

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 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: Problem with BooleanQuery

2011-09-21 Thread Ian Lea
f it is in lucene, read http://wiki.apache.org/lucene-java/ImproveSearchingSpeed -- Ian. On Wed, Sep 21, 2011 at 5:38 PM, Peyman Faratin wrote: > Hi > > The problem I would like to solve is determining the lucene score of a word > in _a particular_ given document. The 2 candidates i ha

Re: Problem with BooleanQuery

2011-09-21 Thread Peyman Faratin
Hi Ian I am not analyzing the title Field titleField = new Field("title", article.getTitle(),Field.Store.YES, Field.Index.NOT_ANALYZED); 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)?

Re: Problem with BooleanQuery

2011-09-22 Thread Ian Lea
t of synch somewhere. What does Luke show? See http://wiki.apache.org/lucene-java/LuceneFAQ#Why_am_I_getting_no_hits_.2BAC8_incorrect_hits.3F for more things to check. > Do you think booleanquery is the right approach for solving the problem > (finding lucene score of a word or a phrase in _a_

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

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: 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. -

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
-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 "

  1   2   3   4   >