PhraseQuery doc

2021-12-13 Thread Claude Lepere
https://lucene.apache.org/core/8_0_0/core/org/apache/lucene/search/PhraseQuery.html#getSlop--, writes the following: For instance, when searching for "quick fox", it is expected that the difference between the positions of fox and quick is 1. So "a quick brown fox" would be at an edit distance of

Re: A question on PhraseQuery and slop

2021-12-13 Thread Michael Sokolov
ching query "quick fox" > against document "the fox is quick". > > Edit distance (Levenshtein) is a bit tricky because it might include a > transposition (just swapping the two words) as edit distance 1 OR 2. > > So maybe Lucene's PhraseQuery is counting t

Re: A question on PhraseQuery and slop

2021-12-13 Thread Michael McCandless
Hello Claude, Hmm, that is interesting that you see slop=2 matching query "quick fox" against document "the fox is quick". Edit distance (Levenshtein) is a bit tricky because it might include a transposition (just swapping the two words) as edit distance 1 OR 2. So maybe Luc

A question on PhraseQuery and slop

2021-12-10 Thread Claude Lepere
ox is quick" would be at an edit distance of 3; this seems inaccurate to me. I don't know if the edit distance used by Lucene is the Levenshtein distance (insertion, deletion, substitution, all of weight 1) - a standard in information retrieval - but a test of "quick fox" Phrase

Re: PhraseQuery

2020-01-24 Thread baris . kazar
Right, i am getting now expected behavior. In the docs i wish the New York example would be continued for clarity and consistence. Best regards On 1/24/20 12:55 PM, Atri Sharma wrote: PhraseQuery enforces the order of terms specified and needs an exact match of order of terms unless slop is

Re: PhraseQuery

2020-01-24 Thread baris . kazar
Thanks for the quick responses, i was having a bug in my code such that i was building multiple PhraseQuery's instead of one PhraseQuery in a loop. Then i was losing order of terms. Best regards On 1/24/20 12:54 PM, Michael Froh wrote: Did you check the Javadoc for PhraseQuery.Bu

Re: PhraseQuery

2020-01-24 Thread Atri Sharma
PhraseQuery enforces the order of terms specified and needs an exact match of order of terms unless slop is specified. When appending terms, term pos numbers need to be incremental in the builder On Fri, Jan 24, 2020 at 11:15 PM wrote: > > Hi,- > > how do i enforce the order of

Re: PhraseQuery

2020-01-24 Thread Michael Froh
lower position than the previous Term. (That is, Term positions must be non-decreasing.) Hope that helps, Michael On Fri, 24 Jan 2020 at 09:45, wrote: > Hi,- > > how do i enforce the order of sequence of terms in the PhraseQuery > builder? > Lucene docs are very hard to underst

PhraseQuery

2020-01-24 Thread baris . kazar
Hi,-  how do i enforce the order of sequence of terms in the PhraseQuery builder?  Lucene docs are very hard to understand in terms of api descriptions. https://lucene.apache.org/core/6_5_0/core/org/apache/lucene/search/PhraseQuery.html Best regards

Re: MultiPhraseQuery or PhraseQuery to take the synonyms into account?

2018-09-22 Thread Michael McCandless
PhraseQuery can indeed be used to represent a multi-token synonym. In fact, I mis-spoke before: MultiPhraseQuery can also represent a multi-token synonym when the multiple tokens are all the same except in one spot. Mike McCandless http://blog.mikemccandless.com On Thu, Sep 20, 2018 at 2:32

Re: MultiPhraseQuery or PhraseQuery to take the synonyms into account?

2018-09-20 Thread baris.kazar
i should have asked this way as Mike made clear for MultiPhraseQuery: is PhraseQuery ok to account for synonyms? Best > On Sep 20, 2018, at 2:02 PM, baris.ka...@oracle.com wrote: > > Hi,- > > should i use MultiPhraseQuery or PhraseQuery to take synonyms into account? &g

MultiPhraseQuery or PhraseQuery to take the synonyms into account?

2018-09-20 Thread baris . kazar
Hi,-  should i use MultiPhraseQuery or PhraseQuery to take synonyms into account? Best regards baris - To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h

Re: PhraseQuery

2016-10-11 Thread lukes
Thanks Mike. I discovered that earlier. Regards. -- View this message in context: http://lucene.472066.n3.nabble.com/PhraseQuery-tp4299871p4300752.html Sent from the Lucene - Java Users mailing list archive at Nabble.com

Re: PhraseQuery

2016-10-10 Thread Michael McCandless
PhraseQuery will not work against StringField: that field indexes the entire string as a single token. Try running it against the TextField instead? Mike McCandless http://blog.mikemccandless.com On Wed, Oct 5, 2016 at 6:52 PM, lukes wrote: > Hi all, > > I am trying to do phr

PhraseQuery

2016-10-05 Thread lukes
(cl, 1); TopDocs topDocs = indexSearcher.search(mq, 10); Am i missing something ? Also for PhraseQuery, i should be querying against StringField, is my assumption right ? Regards. -- View this message in context: http://lucene.472066.n3.nabble.com/PhraseQuery-tp4299871.htm

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: Problem with NGramAnalyzer, PhraseQuery and Highlighter

2016-04-19 Thread Eva Popenda
Hi Alan, thank you, a jira ticket is opened. Cheers, Eva On 18.04.2016 19:01, Alan Woodward wrote: > Hi Eva, > > This looks like a bug in WeightedSpanTermExtractor, which is rewriting your > PhraseQuery into a SpanNearQuery without checking how many terms there are. > Could

Re: Problem with NGramAnalyzer, PhraseQuery and Highlighter

2016-04-18 Thread Alan Woodward
Hi Eva, This looks like a bug in WeightedSpanTermExtractor, which is rewriting your PhraseQuery into a SpanNearQuery without checking how many terms there are. Could you open a JIRA ticket? Alan Woodward www.flax.co.uk > On 18 Apr 2016, at 16:27, Eva Popenda wrote: > > Hi, >

Problem with NGramAnalyzer, PhraseQuery and Highlighter

2016-04-18 Thread Eva Popenda
Hi, I have a problem when using the Highlighter with N-GramAnalyzer and PhraseQuery: Searching for a substring with length = N (4 in my case) yields the following exception: java.lang.IllegalArgumentException: Less than 2 subSpans.size():1 at org.apache.lucene.search.spans.ConjunctionSpans

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

TermQuery or PhraseQuery not working after switching from Lucene 3.6 to 4.6

2014-11-03 Thread Hemant Kumar
?Hi, I'm currently migrating from the really old version 3.6 to 4.6. I deleted my old index and re-indexed everything after migration the whole code base. Now everything works fine except one thing: My search doesn't return any results as soon as I add some TermQuery or PhraseQ

RE: How to use 'PhraseQuery' with Fuzzy?!

2014-09-23 Thread Allison, Timothy B.
If you're looking for a parser, take a look at ComplexPhraseQueryParser or LUCENE-5205. From: Uwe Schindler [u...@thetaphi.de] Sent: Tuesday, September 23, 2014 6:32 AM To: java-user@lucene.apache.org Subject: RE: How to use 'PhraseQuery' w

RE: How to use 'PhraseQuery' with Fuzzy?!

2014-09-23 Thread Uwe Schindler
Hi, You should use a SpanQuery for this use-case. SpanQueries are a generalization of PhraseQuery. You can include a FuzzyQuery using a MTQ wrapper query into a span: SpanNearQuery is the "phrase", consisting of several "SpanMultiTermQueryWrapper(FuzzyQuery)" nodes. Be awa

How to use 'PhraseQuery' with Fuzzy?!

2014-09-22 Thread teko
Hello, Well, I need do a query to locate Phrases like that: Petruz Augusto Petruz Auguzto Petrs Augusto ... Well, in a single word, I can use fuzzy, but, how I can use it in phrases? I think that I need use PhraseQuery, but, I never get any result.. (code below). Thanks [code] IndexReader

Re: Can phrasequery allow mismatch?

2014-07-17 Thread Michael McCandless
I think you could express this with TermAutomatonQuery (https://issues.apache.org/jira/browse/LUCENE-5815 ) but it's likely very slow to run... Mike McCandless http://blog.mikemccandless.com On Thu, Jul 17, 2014 at 3:22 AM, Yonghui Zhao wrote: > Hi, > > I want to implement a query like phrase

Re: Can phrasequery allow mismatch?

2014-07-17 Thread Ian Lea
Might be able to do it with some combination of SpanNearQuery, with suitable values for slop and inOrder, combined into a BooleanQuery with setMinimumNumberShouldMatch = number of SpanNearQuery instances - 1. So, making this up as I go along, you'd have SpanNearQuery sn1 = B after A, slop 0, in o

Can phrasequery allow mismatch?

2014-07-17 Thread Yonghui Zhao
Hi, I want to implement a query like phrase query with slop 0, but I can allow one term mismatch. For example, the text is "A B C D E" I want to match this text with the query "A B C X E". X mismatches the D. i.e. Query "A B C D E" will match “W1 W2 W3 W4 W5”, the 5 words are consecutive

Lucene 4.6 SpanNearQuery or PhraseQuery with Optional term

2014-01-06 Thread Nirav Patel
Hi, Here's my problem, I want to do fuzzy query on "advanced dc motors inc" which matches to all of the following with close score: advanced dc motors inc advanced dc motro incorporation advanced dc motor 1234 inc advance dc motor 1234123 And then I have to evaluate automatically whether I found

Re: Why PhraseQuery translate stopwords to "?"

2013-12-10 Thread Jack Krupansky
Dauphin Sent: Tuesday, December 10, 2013 4:21 AM To: java-user@lucene.apache.org Subject: Re: Why PhraseQuery translate stopwords to "?" Thanks a lot Jack for this explanation! I changed the custom query analyzer to avoid incrementing the position of the subsequent term for each stop word

Re: Why PhraseQuery translate stopwords to "?"

2013-12-10 Thread Jean-Claude Dauphin
ra time for each stop word so that > their positions are maintained. > > -- Jack Krupansky > > -Original Message- From: Jean-Claude Dauphin > Sent: Monday, December 09, 2013 4:15 PM > To: java-user@lucene.apache.org > Subject: Why PhraseQuery translate stopwords to &quo

Re: Why PhraseQuery translate stopwords to "?"

2013-12-09 Thread Jack Krupansky
: java-user@lucene.apache.org Subject: Why PhraseQuery translate stopwords to "?" Hi, My application uses an analyzer with a StopWordFilter. PhraseQuery translates queries with stopwords by replacing stopwords to "?" characters. For example, "Java and Lucene" is repla

Why PhraseQuery translate stopwords to "?"

2013-12-09 Thread Jean-Claude Dauphin
Hi, My application uses an analyzer with a StopWordFilter. PhraseQuery translates queries with stopwords by replacing stopwords to "?" characters. For example, "Java and Lucene" is replaced by "Java ? Lucene" and "to contribute" is replaced by "

Re: PhraseQuery boost doesn't affect ScoreDoc.score

2013-10-17 Thread Ian Lea
ew TextField("blurb", "This book is brilliant", Field.Store.YES)); writer.addDocument(doc2); } IndexSearcher searcher = new IndexSearcher(DirectoryReader.open(dir)); search(searcher, 1, args[0]); search(searcher, 5, args[0]); } private static void search(I

PhraseQuery boost doesn't affect ScoreDoc.score

2013-10-15 Thread denis.zhdanov
Hello, Have a question about default PhraseQuery boost processing. The Query.setBoost() <http://lucene.apache.org/core/4_4_0/core/org/apache/lucene/search/Query.html#setBoost(float)> says: / Sets the boost for this query clause to b. Documents matching this clause will (in addition

Re: Wildcard in PhraseQuery

2013-08-27 Thread mark harwood
See  http://lucene.apache.org/core/4_3_1/queryparser/org/apache/lucene/queryparser/complexPhrase/ComplexPhraseQueryParser.html From: Ian Lea To: java-user@lucene.apache.org Sent: Tuesday, 27 August 2013, 10:16 Subject: Re: Wildcard in PhraseQuery See the

Re: Wildcard in PhraseQuery

2013-08-27 Thread Ian Lea
See the FAQ: http://wiki.apache.org/lucene-java/LuceneFAQ#Can_I_combine_wildcard_and_phrase_search.2C_e.g._.22foo_ba.2A.22.3F -- Ian. On Tue, Aug 27, 2013 at 5:11 AM, Chuming Chen wrote: > Hi All, > > Can I use wildcard in a phrase query in Lucene/Solr? Can anybody point me > some directions

Wildcard in PhraseQuery

2013-08-26 Thread Chuming Chen
Hi All, Can I use wildcard in a phrase query in Lucene/Solr? Can anybody point me some directions to look into? Thanks, Chuming - To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail

RE: PhraseQuery Search

2013-08-05 Thread Allison, Timothy B.
@lucene.apache.org Subject: PhraseQuery Search Hi, I have been using the regular Query class to search single keywords. I needed to include hits such as "BANKER" if the user searched for "BANK". To achieve this I used "*" on both sides as *BANK*. Now I need to search f

PhraseQuery Search

2013-08-02 Thread raghavendra.k.rao
Hi, I have been using the regular Query class to search single keywords. I needed to include hits such as "BANKER" if the user searched for "BANK". To achieve this I used "*" on both sides as *BANK*. Now I need to search for phrases and I am building a PhraseQuer

Re: [PhraseQuery] Can "jakarta apache"~10 be searched by offset ?

2013-05-13 Thread Jack Krupansky
est. Or, you can file a Jira for a new Lucene Query for phrase and or span queries that measures distance by offsets rather than positions. -- Jack Krupansky -Original Message- From: wgggfiy Sent: Monday, May 13, 2013 3:47 AM To: java-user@lucene.apache.org Subject: Re: [PhraseQuery

Re: [PhraseQuery] Can "jakarta apache"~10 be searched by offset ?

2013-05-13 Thread wgggfiy
); - -- Email: wuqiu.m...@qq.com -- -- View this message in context: http://lucene.472066.n3.nabble.com/PhraseQuery-Can-jakarta-apache-10-be-searched-by-offset-tp4061243p4062852.html Sent from the Lucene - Java Users mailing list archive at Nabble.com.

RE: [PhraseQuery] Can "jakarta apache"~10 be searched by offset ?

2013-05-07 Thread wgggfiy
l: wuqiu.m...@qq.com -- -- View this message in context: http://lucene.472066.n3.nabble.com/PhraseQuery-Can-jakarta-apache-10-be-searched-by-offset-tp4061243p4061305.html Sent from the Lucene - Java Users mailing list archive at Nabble.com.

RE: [PhraseQuery] Can "jakarta apache"~10 be searched by offset ?

2013-05-07 Thread Uwe Schindler
has a begin and end offset, so it's not just a copy of (Sloppy-)PhraseQuery. Uwe - Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: u...@thetaphi.de > -Original Message- > From: wgggfiy [mailto:wuqiu.m...@qq.com] > Sent: Tuesday, May 07

Re: [PhraseQuery] Can "jakarta apache"~10 be searched by offset ?

2013-05-06 Thread wgggfiy
isfied the regex "jakarta.{1,10}apache" - -- Email: wuqiu.m...@qq.com -- -- View this message in context: http://lucene.472066.n3.nabble.com/PhraseQuery-Can-jakarta-apache-10-be-searched-by-offset-tp4061243p4061260.html Sent from t

Re: [PhraseQuery] Can "jakarta apache"~10 be searched by offset ?

2013-05-06 Thread Jack Krupansky
gfiy Sent: Monday, May 06, 2013 11:39 PM To: java-user@lucene.apache.org Subject: [PhraseQuery] Can "jakarta apache"~10 be searched by offset ? As I know, the syntax *"jakarta apache"~10*, which is a PhraseQuery with a slop=10 in position, but What I want is *based on offset* not o

[PhraseQuery] Can "jakarta apache"~10 be searched by offset ?

2013-05-06 Thread wgggfiy
As I know, the syntax *"jakarta apache"~10*, which is a PhraseQuery with a slop=10 in position, but What I want is *based on offset* not on position? Anyone can help me ? thx. - -- Email: wuqiu.m...@qq.com -- -- View this message

Re: Is it possible to combine Wildcard and Phrasequery for the Queryparser

2011-10-13 Thread Dmitry Savenko
: Is it possible to combine Wildcard and Phrasequery for the Queryparser Hello, i'm trying to search the following phase: I'm searching all occurrences of: . "The Right Way" . "The Right Ways" Possible solutions could be something like this

Is it possible to combine Wildcard and Phrasequery for the Queryparser

2011-10-13 Thread Ralf Heyde
Hello, i'm trying to search the following phase: I'm searching all occurrences of: . "The Right Way" . "The Right Ways" Possible solutions could be something like this - combining a phrase & wildcard search: . title:"The Right Way*" . title:"The Ri

PhraseQuery with huge "slop"?

2011-04-07 Thread sol myr
advice from this list, I combined 2 separate queries (the query "+BIG +BEN" and the exact-phrase "\"BIG BEN\""). But someone suggested an alternative: PhraseQuery with a very large SLOP. Such SLOP would cover all appearances of theses words in the document (even far

Re: A question regarding the setSlop method of class PhraseQuery (Lucene version 3.0.1)

2010-06-29 Thread Erick Erickson
; > > > > your search phrase : "This is a formal test" > >> > > > > your setting the slop factor 2 , now if your slop factor is 3 it > >> > should > >> > > > > work > >> > > > > because "is" and &quo

Re: A question regarding the setSlop method of class PhraseQuery (Lucene version 3.0.1)

2010-06-29 Thread a peng
slop factor apart but in your search phrase "This is a formal >> test" >> > the >> > > > > words "This" and "test" are 3 slop factor thats why it's nor >> working >> > > > > now in search phrase &quo

Re: A question regarding the setSlop method of class PhraseQuery (Lucene version 3.0.1)

2010-06-28 Thread a peng
working > > > > > now in search phrase "This is formal test" the words "This" and > > "test" > > > > are > > > > > 2 > > > > > slop factor apart thats why this phrase is working. > > >

Re: A question regarding the setSlop method of class PhraseQuery (Lucene version 3.0.1)

2010-06-28 Thread Erick Erickson
; slop factor apart thats why this phrase is working. > > > > > > > > > > > > > > > > On Mon, Jun 28, 2010 at 11:37 AM, a peng > > wrote: > > > > > > > > > Hi, > > > > > > > > >

Re: A question regarding the setSlop method of class PhraseQuery (Lucene version 3.0.1)

2010-06-28 Thread tarun sapra
peng > wrote: > > > > > > > Hi, > > > > > > > > I am using StandardAnalyzer(Version.LUCENE_30); > > > > > > > > 2010/6/27 tarun sapra > > > > > > > > > which analyzer are you usin'? > > >

Re: A question regarding the setSlop method of class PhraseQuery (Lucene version 3.0.1)

2010-06-28 Thread Erick Erickson
using StandardAnalyzer(Version.LUCENE_30); > > > > > > 2010/6/27 tarun sapra > > > > > > > which analyzer are you usin'? > > > > > > > > > > > > On Sun, Jun 27, 2010 at 7:12 AM, a peng > > wrote: > > > >

Re: A question regarding the setSlop method of class PhraseQuery (Lucene version 3.0.1)

2010-06-28 Thread a peng
t; > > 2010/6/27 tarun sapra > > > > > which analyzer are you usin'? > > > > > > > > > On Sun, Jun 27, 2010 at 7:12 AM, a peng > wrote: > > > > > > > Hi, > > > > > > > > I know the indexed content con

Re: A question regarding the setSlop method of class PhraseQuery (Lucene version 3.0.1)

2010-06-27 Thread tarun sapra
7;? > > > > > > On Sun, Jun 27, 2010 at 7:12 AM, a peng wrote: > > > > > Hi, > > > > > > I know the indexed content contains the following text: "This is a > test". > > > And the search phrase I used is "This is a formal

Re: A question regarding the setSlop method of class PhraseQuery (Lucene version 3.0.1)

2010-06-27 Thread a peng
quot;. > > And the search phrase I used is "This is a formal test", and then I set > the > > slop of the PhraseQuery as 2 with setSlop(2), but I found that I can not > > get > > a search result. If I set the search phrase as "This is formal test", >

Re: A question regarding the setSlop method of class PhraseQuery (Lucene version 3.0.1)

2010-06-27 Thread tarun sapra
which analyzer are you usin'? On Sun, Jun 27, 2010 at 7:12 AM, a peng wrote: > Hi, > > I know the indexed content contains the following text: "This is a test". > And the search phrase I used is "This is a formal test", and then I set the > slop of the

A question regarding the setSlop method of class PhraseQuery (Lucene version 3.0.1)

2010-06-27 Thread a peng
Hi, I know the indexed content contains the following text: "This is a test". And the search phrase I used is "This is a formal test", and then I set the slop of the PhraseQuery as 2 with setSlop(2), but I found that I can not get a search result. If I set the search phras

Difference between PhraseQuery and Span(Near)Query

2010-06-18 Thread syedfa
Dear fellow Java developers: I am reading up on PhraseQuery to search for an exact match for terms that appear exactly in a particular order for a field (i.e. slop value of 0). However, I came across SpanNearQuery which appears to work in a similar fashion, but am confused, due to it&#

Re: PhraseQuery vs MultiPhraseQuery

2010-05-28 Thread Ahmet Arslan
> Is there a fundamental difference between > > PhraseQuery query = new PhraseQuery(); > query.add(term1, 0); > query.add(term2, 0); > > and > > MultiPhraseQuery query = new MultiPhraseQuery(); > query.add( new Term[] { term1, term2 } ); > > The only di

Re: Surround QueryParser and PhraseQuery

2010-05-28 Thread Ahmet Arslan
> I'm having problem with searching phrase and using Surround > Query Parser, so > let look at input surround queries (test examples) >    1. "yellow orange" >    2. lemon 2n ("yellow orange") 4n banana > where 2n, 4n are within connectors. You d

PhraseQuery vs MultiPhraseQuery

2010-05-28 Thread Emmanuel Bernard
Hello, I am a bit confused by the two. Is there a fundamental difference between PhraseQuery query = new PhraseQuery(); query.add(term1, 0); query.add(term2, 0); and MultiPhraseQuery query = new MultiPhraseQuery(); query.add( new Term[] { term1, term2 } ); The only different I could think of

Surround QueryParser and PhraseQuery

2010-05-28 Thread flaiz
ge into quotes to let the parser know this is PhraseQuery, but unfortunately the parser does not support PhraseQuery at all. Could you please advice some workaround for such situation? How I should handle such queries to get results from an index? I believe this is common problem and there already i

Re: PhraseQuery Performance Issues [Lucene 2.9.0]

2010-03-29 Thread Rafael Turk
unsubscribe - To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org

Re: another question about phrasequery?(thanks again)

2010-03-22 Thread luocan19826164
ch).do I describe clearly? for example:Document 1: little boy is running Document 2:boy is little when I query "little boy",Document 1 add score 100(Exact match),but Document 2 add score 0( not Exact match) - 原文 - 发件人: luocan19826...@sohu.com 主 题: Re: another question about phrasequery?(th

Re: another question about phrasequery?(thanks again)

2010-03-22 Thread luocan19826164
t exactly match the query(term position totally match).do I describe clearly?     for example: Document 1: little boy is runningDocument 2:boy is littleI query "little boy" Document 1 add score 100(Exact match)Document 2 add score 0( not Exact match) - 原文 - 发件人: Ian Lea 主 题: Re: an

Re: PhraseQuery Performance Issues [Lucene 2.9.0]

2010-03-22 Thread Daniel Shane
java-user@lucene.apache.org Sent: Friday, March 19, 2010 7:14:06 PM Subject: Re: PhraseQuery Performance Issues [Lucene 2.9.0] Nutch/Solr's CommonGrams is the right way to solve this. It combines frequent terms (eg stopwords) with adjacent terms. So "the wizard of oz" will be indexed e

Re: another question about phrasequery?(thanks again)

2010-03-22 Thread Ian Lea
se query boosted. -- Ian. On Mon, Mar 22, 2010 at 2:13 PM, luocanrao wrote: > I don't think the current phrasequery can meet my requirement. > > Can someone help me implement such a phrasequery? > > > > Exact match document add some score > > All other match d

another question about phrasequery?(thanks again)

2010-03-22 Thread luocanrao
I don't think the current phrasequery can meet my requirement. Can someone help me implement such a phrasequery? Exact match document add some score All other match document add 0 score.(no matter how big slop is) For example: Document 1: little boy is running Document 2:boy is l

can I have such a phrasequery?

2010-03-21 Thread luocanrao
Can I have suche a phrasequery. Exact match document add some score All other match document add 0 score. But all the documents that have the terms are valid. For example: Document 1: little boy is running Document 2:boy is little, I query little boy, Document 1 add score 100(Exact

can I have such a phrasequery?

2010-03-20 Thread luocanrao
Can I have suche a phrasequery. Exact match document add some score All other match document add 0 score. But all the documents that have the terms are valid. For example: Document 1: little boy is running Document 2:boy is little, I query little boy, Document 1 add score 100(Exact match

Re: PhraseQuery Performance Issues [Lucene 2.9.0]

2010-03-19 Thread Michael McCandless
same term expansion works. Lucene does no caching that'd speed up PhraseQuery (unless that was the very first query against the field since you opened the reader) -- this is probably the OS's IO cache. Mike On Fri, Mar 19, 2010 at 3:56 PM, Daniel Shane wrote: > I'm running a me

PhraseQuery Performance Issues [Lucene 2.9.0]

2010-03-19 Thread Daniel Shane
I'm running a medium size web search with a index size just shy of 9GB with 80 docs in it. We are suing Lucene version 2.9.0 (we have not checked yet to see if this applies to older versions as well). By looking at my logs, I'm finding that phrase queries are especially long to perform. In

Search a PhraseQuery one multiple terms with the same position

2010-01-28 Thread Karsten F.
.add(f); indexWriter.addDocument(testDocument); indexWriter.commit(); indexWriter.close(); IndexReader iR = IndexReader.open(ramDirectory); IndexSearcher indexSearcher = new IndexSearcher(iR); PhraseQuery query = new PhraseQuery();

Re: PhraseQuery with term positions

2010-01-19 Thread Avi Rosenschein
upon your needs. > > Erick > > On Tue, Jan 19, 2010 at 6:50 AM, Avi Rosenschein >wrote: > > > Hi, > > > > I am using PhraseQuery with explicitly set term positions and slop=0, in > > order to skip stop words. The field in my index is indexed with > T

Re: PhraseQuery with term positions

2010-01-19 Thread Erick Erickson
How big is your index? Because the simplest thing would be to just not remove stopwords at index or query time. Perhaps in a duplicate field depending upon your needs. Erick On Tue, Jan 19, 2010 at 6:50 AM, Avi Rosenschein wrote: > Hi, > > I am using PhraseQuery with explicitly

PhraseQuery with term positions

2010-01-19 Thread Avi Rosenschein
Hi, I am using PhraseQuery with explicitly set term positions and slop=0, in order to skip stop words. The field in my index is indexed with TermVector positions. When I do a query with stop words skipped, for example "internet for research" (translated into PhraseQuery: "inte

Is it possible to do a PhraseQuery using XML Query Parser?

2010-01-12 Thread syedfa
Dear fellow Java developers: Is it possible to do a PhraseQuery when using the XML Query Parser? I checked the documentation for the XML Query Parser, and it has tags for a multitude of queries, with PhraseQuery absent from the list. Is it possible to do a PhraseQuery using the XMLQueryParser

Re: Problem with PhraseQuery

2010-01-05 Thread Simon Willnauer
ring). The analyzed query will then match and retrieve your documents. try to search : > PhraseQuery q = new PhraseQuery(); >q.setSlop(1); >q.add(new Term("title","lucene")); >q.add(new Term("title","for")); simon . 2010/1/5 Mário

Problem with PhraseQuery

2010-01-05 Thread Mário André
Hi, I need search by phrase containing a particular sequence of terms , then I am using Java Lucene 3.0, more specifically the PhraseQuery. I'm using the code below, but does not work(PhraseQuery). Only does work when I use the QueryParser: Is there some problem or how can I use the Phrase

RE: Edit distance and wildcard searching with PhraseQuery

2009-11-11 Thread Jeff Plater
@lucene.apache.org Subject: Re: Edit distance and wildcard searching with PhraseQuery I'd at use something that lowercases the input rather than just WhitespaceAnalyzer. Remember to use it at index time and query time. Between your queries and typing things in e-mails, case is often a gotcha

Re: Edit distance and wildcard searching with PhraseQuery

2009-11-11 Thread Erick Erickson
ceAnalyzer)?. Have you used it with wildcard > before? > > -Jeff > > -Original Message- > From: AHMET ARSLAN [mailto:iori...@yahoo.com] > Sent: Wednesday, November 11, 2009 5:55 PM > To: java-user@lucene.apache.org > Subject: Re: Edit distance

RE: Edit distance and wildcard searching with PhraseQuery

2009-11-11 Thread Jeff Plater
e- From: AHMET ARSLAN [mailto:iori...@yahoo.com] Sent: Wednesday, November 11, 2009 5:55 PM To: java-user@lucene.apache.org Subject: Re: Edit distance and wildcard searching with PhraseQuery What you are looking for is ComplexPhraseQueryParser [1] and implemented in Lucene 2.9.0. It uses SpanQuery f

Re: Edit distance and wildcard searching with PhraseQuery

2009-11-11 Thread AHMET ARSLAN
What you are looking for is ComplexPhraseQueryParser [1] and implemented in Lucene 2.9.0. It uses SpanQuery family. It supports "Phil* PA"~10 as well as "Philadelphid~0.75 PA". Ranges, OR, fuzzy and wildcard inside proximity (phrases). [1] http://lucene.apache.org/java/2_9_0/api/contrib-misc/o

Edit distance and wildcard searching with PhraseQuery

2009-11-11 Thread Jeff Plater
Hi, I am trying to figure out a way that I can query a Lucene index for a phrase but have some fuzziness (edit distance and/or wildcard) applied to the individual terms. An example should help explain what I am trying to do: Index contains: Philadelphia PA Search is done on: Philadel

Re: PhraseQuery in BooleanQuery not working properly in 2.9.0

2009-10-14 Thread Ion Barcan
Yes, the fix in src/java/org/apache/lucene/search/Scorer.java solves my problem, i.e. the queries return the correct number of results. On Wed, Oct 14, 2009 at 12:29 PM, Michael McCandless wrote: > It sounds likely that this is > https://issues.apache.org/jira/browse/LUCENE-1974 > > Is it possib

Re: PhraseQuery in BooleanQuery not working properly in 2.9.0

2009-10-14 Thread Michael McCandless
pprox. 30 > million documents) running BooleanQueries containing PhraseQuery does > not work properly. I've verified this on both optimized and > unoptimized index versions. > > For example: > > lucli> count field1:"john doe" > Searching for: field1:"j

Re: PhraseQuery in BooleanQuery not working properly in 2.9.0

2009-10-13 Thread Chris Hostetter
: With the new Lucene 2.9.0 (on a newly built index of approx. 30 : million documents) running BooleanQueries containing PhraseQuery does : not work properly. I've verified this on both optimized and : unoptimized index versions. I suspect that this is the same problem as identified in L

PhraseQuery in BooleanQuery not working properly in 2.9.0

2009-10-13 Thread Ion Barcan
Hello, With the new Lucene 2.9.0 (on a newly built index of approx. 30 million documents) running BooleanQueries containing PhraseQuery does not work properly. I've verified this on both optimized and unoptimized index versions. For example: lucli> count field1:"john doe" Sea

Complexity of PhraseQuery slop?

2009-08-12 Thread Jason Rutherglen
In trying to calculate the cost of various slop settings for phrase queries, what's the time complexity? O(n) or O(n^2)? - To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user

Incorrect search result with PhraseQuery

2009-05-25 Thread ac
hi, has anyone stumble across this problem where PhraseQuery leads to incorrect results? In my specific case PhraseQuery would become equivilent to a set of disjunctive term queries. However, upon restarting my application (inside tomcat) PhraseQuery would work again. The logic that produces query

Re: Getting matched words for PhraseQuery or SpanNearQuery

2009-04-28 Thread Jaco
am searching in is [a b c a d e f a b], and my query is [a >> b], >> then I want to know where the words [a b] were matched together in the >> text >> due to the use of the PhraseQuery/SpanNearQuery ([a b] will get me two >> occurrences in the documents text). >> &

Re: Getting matched words for PhraseQuery or SpanNearQuery

2009-04-28 Thread Mark Miller
ormation in the text. For example, if the text I am searching in is [a b c a d e f a b], and my query is [a b], then I want to know where the words [a b] were matched together in the text due to the use of the PhraseQuery/SpanNearQuery ([a b] will get me two occurrences in the documents text). As fa

Getting matched words for PhraseQuery or SpanNearQuery

2009-04-28 Thread Jaco
b], then I want to know where the words [a b] were matched together in the text due to the use of the PhraseQuery/SpanNearQuery ([a b] will get me two occurrences in the documents text). As far as I can find out, the highlighter is capable of marking the individual words causing the hit, but i

Re: Analyse TermQuery and PhraseQuery

2009-02-19 Thread Grant Ingersoll
On Feb 19, 2009, at 5:54 AM, Nada Mimouni wrote: Hello, String ws = " "; String query = "The"+ws+"president"+ws+"of"+ws+"the"+ws+"USA"+ws +"is"+ws+""\Barak Obama\""; Query q = QueryParser.parse(query, new StandardAnalyser()); Query q = QueryParser.parse(query, new WhitespaceAnalyser());

Analyse TermQuery and PhraseQuery

2009-02-19 Thread Nada Mimouni
Hello, String ws = " "; String query = "The"+ws+"president"+ws+"of"+ws+"the"+ws+"USA"+ws+"is"+ws+""\Barak Obama\""; Query q = QueryParser.parse(query, new StandardAnalyser()); Query q = QueryParser.parse(query, new WhitespaceAnalyser()); In this example: - could we create a query in such a fo

  1   2   3   >