Re: find the collection of tokens matching a query in Lucene 8.6.3

2021-07-09 Thread Laurent Jakubina
Hi, Never done in myself, but from the doc : >From the query ( https://lucene.apache.org/core/8_6_3/core/org/apache/lucene/search/Query.html), you can retrieve the Weight ( https://lucene.apache.org/core/8_6_3/core/org/apache/lucene/search/Weight.html), from which you can access the Matches ( http

find the collection of tokens matching a query in Lucene 8.6.3

2021-07-09 Thread Trevor Nicholls
Problem: I have indexed the filepath and the content of thousands of documents and can successfully query the index on the text to return a collection of filepaths. Now I need to create a collection of the tokens in the index which matched the query. I can see that there are solutions to a rela

Integer Range Query in Lucene 4.10.4 not working as expected.

2017-06-30 Thread andi rexha
I have a numeric range query to perform in an index. I begin by indexing a document with a field value of "300". When I search for a range [100 TO 400] I get results from the search operation. Strangely enough, when I search for [100 TO 4000], I don't get any search results. Here is a code sni

Re: Creating composite query in lucene

2016-03-09 Thread sandeep das
Hi Jack, Thanks a lot for your suggestion. Regards, Sandeep On Tue, Mar 8, 2016 at 8:32 PM, Jack Krupansky wrote: > BooleanQuery can be nested, so you do a top-level BQ that has two clauses, > the first a TQ for a:x and the second another BQ that itself has two > clauses, both SHOULD. > > -- J

Re: Creating composite query in lucene

2016-03-08 Thread Jack Krupansky
BooleanQuery can be nested, so you do a top-level BQ that has two clauses, the first a TQ for a:x and the second another BQ that itself has two clauses, both SHOULD. -- Jack Krupansky On Tue, Mar 8, 2016 at 4:38 AM, sandeep das wrote: > Hi, > > I'm using lucene-5.2.0 and in query interface I wi

Creating composite query in lucene

2016-03-08 Thread sandeep das
Hi, I'm using lucene-5.2.0 and in query interface I wish to compose a query like "a=x and (b=y or d=z)" Which can be described as If any document has value "x" for field "a" and field "b" has value "y" or field "d" has value "z" then that document should be chosen. There are three fields in my d

Re: how to write this SOLR query in LUCENE api?

2015-09-17 Thread Trejkaz
On Fri, Sep 18, 2015 at 1:14 AM, Ziqi Zhang wrote: => > So my question is, how can I achieve the same by using the Lucene API, not > solr? I looked into the org.apache.solr.handler.component.TermsComponent > class but it is not very obvious for me. org.apache.lucene.search.RegexpQuery. Or, if yo

how to write this SOLR query in LUCENE api?

2015-09-17 Thread Ziqi Zhang
Hi I am using the TermsComponent in my solr config like this to deal with queries about terms in the index: -- true false terms --- For example, I want to fetch any *terms* containing "surface defects". Using solr I can d

Re: Problem with MultiPhrase Query in Lucene 4.3

2013-10-03 Thread VIGNESH S
_args[1]); > } > } > > > On Thu, Oct 3, 2013 at 4:10 PM, VIGNESH S wrote: > > Hi, > > > > sorry.. thats my typo.. > > > > Its not failing because of that > > > > > > On Thu, Oct 3, 2013 at 8:17 PM, Ian Lea wrote: > >

Re: Problem with MultiPhrase Query in Lucene 4.3

2013-10-03 Thread Ian Lea
(); t.test(_args[0], _args[1]); } } On Thu, Oct 3, 2013 at 4:10 PM, VIGNESH S wrote: > Hi, > > sorry.. thats my typo.. > > Its not failing because of that > > > On Thu, Oct 3, 2013 at 8:17 PM, Ian Lea wrote: > >> Are you sure it's not failing because

Re: Problem with MultiPhrase Query in Lucene 4.3

2013-10-03 Thread VIGNESH S
t; > Hi, > > > > I am Trying to do Multiphrase Query in Lucene 4.3. It is working Perfect > > for all scenarios except the below scenario. > > When I try to Search for a phrase which is preceded by any punctuation,it > > is not working.. > > > > Text

Re: Problem with MultiPhrase Query in Lucene 4.3

2013-10-03 Thread Ian Lea
Are you sure it's not failing because "adhoc" != "ad-hoc"? -- Ian. On Thu, Oct 3, 2013 at 3:07 PM, VIGNESH S wrote: > Hi, > > I am Trying to do Multiphrase Query in Lucene 4.3. It is working Perfect > for all scenarios except the below scenario. > Wh

Problem with MultiPhrase Query in Lucene 4.3

2013-10-03 Thread VIGNESH S
Hi, I am Trying to do Multiphrase Query in Lucene 4.3. It is working Perfect for all scenarios except the below scenario. When I try to Search for a phrase which is preceded by any punctuation,it is not working.. TextContent: Dremel is a scalable, interactive ad-hoc query system for analysis of

Re: Multiphrase Query in Lucene 4.3

2013-10-03 Thread Ian Lea
>>> >> Romer".But >> >>> >> > When i do a Search,it is not returning Hits.This Problem I am >> facing >> >>> is >> >>> >> not >> >>> >> > for all phrases >> >>> >> > Th

Re: Multiphrase Query in Lucene 4.3

2013-10-03 Thread VIGNESH S
y it is not able to find "geoffrey". I confirmed > >>> this > >>> >> by > >>> >> > doing trm.seekCeil(new BytesRef("Geoffrey")) and then and then > when > >>> i > >>> >> > do String s = trm.term().u

Re: Multiphrase Query in Lucene 4.3

2013-10-03 Thread Ian Lea
>> >> > instead of geoffrey.seekceil is working properly for many phrases >>> though. >>> >> > >>> >> > What could be the problem..please kindly suggest. >>> >> > >>> >> > >>> >> > >&

Re: Multiphrase Query in Lucene 4.3

2013-10-02 Thread VIGNESH S
the problem..please kindly suggest. >> >> > >> >> > >> >> > >> >> > On Fri, Sep 27, 2013 at 6:58 PM, Allison, Timothy B. < >> talli...@mitre.org >> >> >wrote: >> >> > >> >>

Re: Multiphrase Query in Lucene 4.3

2013-10-02 Thread VIGNESH S
; >> >> 1) An alternate method to your original question would be to do > >> something > >> >> like this (I haven't compiled or tested this!): > >> >> > >> >> Query q = new PrefixQuery(new Term("field", &quo

Re: Multiphrase Query in Lucene 4.3

2013-09-30 Thread Ian Lea
;> q.extractTerms(terms); >> >> Term[] arr = terms.toArray(new Term[terms.size()]); >> >> MultiPhraseQuery mpq = new MultiPhraseQuery(); >> >> mpq.add(new Term("field", "microsoft"); >> >> mpq.add(arr); >> >> >>

Re: Multiphrase Query in Lucene 4.3

2013-09-30 Thread VIGNESH S
.toArray(new Term[terms.size()]); > >> MultiPhraseQuery mpq = new MultiPhraseQuery(); > >> mpq.add(new Term("field", "microsoft"); > >> mpq.add(arr); > >> > >> > >> 2) At a higher level, do you need to generate your query > pro

Re: Multiphrase Query in Lucene 4.3

2013-09-30 Thread Ian Lea
d.parser.QueryParser >> c) experimental: >> http://issues.apache.org/jira/browse/LUCENE-5205 >> >> >> -Original Message- >> From: VIGNESH S [mailto:vigneshkln...@gmail.com] >> Sent: Friday, September 27, 2013 3:33 AM >> To: java-user@lucene.apache.or

Re: Multiphrase Query in Lucene 4.3

2013-09-29 Thread VIGNESH S
ComplexPhraseQueryParser > b) SurroundQueryParser: oal.queryparser.surround.parser.QueryParser > c) experimental: > http://issues.apache.org/jira/browse/LUCENE-5205 > > > -Original Message- > From: VIGNESH S [mailto:vigneshkln...@gmail.com] > Sent: Friday, September

RE: Multiphrase Query in Lucene 4.3

2013-09-27 Thread Allison, Timothy B.
lexPhraseQueryParser b) SurroundQueryParser: oal.queryparser.surround.parser.QueryParser c) experimental: http://issues.apache.org/jira/browse/LUCENE-5205 -Original Message- From: VIGNESH S [mailto:vigneshkln...@gmail.com] Sent: Friday, September 27, 2013 3:33 AM To: java-user@lucene.apache

Re: Multiphrase Query in Lucene 4.3

2013-09-27 Thread VIGNESH S
Hi, The word i am giving is "Romer Geoffrey ".The Word is in the Field. trm.seekCeil(new BytesRef("Geoffrey")) and then when i do String s = trm.term().utf8ToString(); and hence It is giving a diffrent word..I think this is why my multiphrasequery is not giving desired results. What may be the

Re: Multiphrase Query in Lucene 4.3

2013-09-26 Thread VIGNESH S
Hi Lan, Thanks for your Reply. I am doing similar to this only..In MultiPhraseQuery object actual phrase is going proper but it is not returning any hits.. In Lucene 3.6,I implemented the same logic and it is working. In Lucene 4.3,I implemented the Index for that using FieldType offsetsType

Re: Multiphrase Query in Lucene 4.3

2013-09-26 Thread Ian Lea
I use the code below to do something like this. Not exactly what you want but should be easy to adapt. public List findTerms(IndexReader _reader, String _field) throws IOException { List l = new ArrayList(); Fields ff = MultiFields.getFields(_reader); Terms tr

Multiphrase Query in Lucene 4.3

2013-09-25 Thread VIGNESH S
Hi, In the Example of Multiphrase Query it is mentioned "To use this class, to search for the phrase "Microsoft app*" first use add(Term) on the term "Microsoft", then find all terms that have "app" as prefix using IndexReader.terms(Term), and use MultiPhraseQuery.add(Term[] terms) to add them to

Re: Exact Match Query in Lucene with SnowBall Analyzer

2012-05-09 Thread Jan Høydahl
Hi, The behavior is expected with stemming. Have you tried using StandardAnalyzer which do not do stemming? -- Jan Høydahl, search solution architect Cominvent AS - www.cominvent.com Solr Training - www.solrtraining.com On 9. mai 2012, at 08:12, Yogesh patel wrote: > I am using Lucene and i hav

Exact Match Query in Lucene with SnowBall Analyzer

2012-05-08 Thread Yogesh patel
I am using Lucene and i have one question about it I am using Snowball analyzer with English version. My index has below columns (1) id (2) Content i.e Id Content _ 1 This is murder case and murdering is crime 2 The wife of a Mumbai

Re: Is there any "Query" in Lucene can search the term, which is similar as "SQL-LIKE"?

2011-10-17 Thread Sujit Pal
ram88||';'||mv.c_param89||';'||mv.c_param90||';'||mv.c_param91||';'||mv.c_param92||';'||mv.c_param93||';'||mv.c_param94||';'||mv.c_param95||';'||mv.c_param96||';'||mv.c_param97||';'||mv.c_param98||

Re: Is there any "Query" in Lucene can search the term, which is similar as "SQL-LIKE"?

2011-10-12 Thread Mead Lai
7;||mv.c_param84||';'||mv.c_param85||';'||mv.c_param86||';'||mv.c_param87||';'||mv.c_param88||';'||mv.c_param89||';'||mv.c_param90||';'||mv.c_param91||';'||mv.c_param92||';'||mv.c_param93||';'||mv.c_pa

Re: Is there any "Query" in Lucene can search the term, which is similar as "SQL-LIKE"?

2011-10-12 Thread Mead Lai
27;||mv.c_param87||';'||mv.c_param88||';'||mv.c_param89||';'||mv.c_param90||';'||mv.c_param91||';'||mv.c_param92||';'||mv.c_param93||';'||mv.c_param94||';'||mv.c_param95||';'||mv.c_param96||';'||mv.c_param

Re: Is there any "Query" in Lucene can search the term, which is similar as "SQL-LIKE"?

2011-10-11 Thread Chris Lu
ram94||';'||mv.c_param95||';'||mv.c_param96||';'||mv.c_param97||';'||mv.c_param98||';'||mv.c_param99||';'||mv.c_param100||';' > FROM MyTable mv > > *=Step2*: search the view with LIKE '%keyword%' > > SELECT * > FROM V_MY_VIEW wcv > WHERE wcv.content LIKE '%keyword%' > > Finally, it works nice, but inefficiency, almost cost 5~7 seconds. cos ONE > MILLION rows are tooo huge. > > *Lucene way:* >So, I use the Lucene to store these ONE MILLION data, > code:document.add(new Field("content", content, Store.YES, > Index.ANALYZED));//variable content, is the strings which jointed from the > 100 columns > The problem is that: if some keyword is not a word or a term, the > search will return nothing. > Usually, the keyword would be a person's name or some jargon, like > 'catstiger.amber','amin.ahmad','fund-in-trust'. > and 'catstiger.amber' can't be split into a term to save in the index store >Cos, the Index.ANALYZED would fail to recognition the keyword as a term > , so there is no such index at all. > So, In short, is there any "Query" in Lucene can search the term, which is > similar as "SQL-LIKE"? > >This SQL-function will meet the purpose: > > SELECT * FROM luceneDB ldb > WHERE ldb.content *LIKE* '%keyword%' > > Thank you very much. > > Regards, > Mead >

Re: Is there any "Query" in Lucene can search the term, which is similar as "SQL-LIKE"?

2011-10-11 Thread Ian Lea
v.c_param89||';'||mv.c_param90||';'||mv.c_param91||';'||mv.c_param92||';'||mv.c_param93||';'||mv.c_param94||';'||mv.c_param95||';'||mv.c_param96||';'||mv.c_param97||';'||mv.c_param98||';'||mv.c_p

Is there any "Query" in Lucene can search the term, which is similar as "SQL-LIKE"?

2011-10-11 Thread Mead Lai
#x27;;'||mv.c_param92||';'||mv.c_param93||';'||mv.c_param94||';'||mv.c_param95||';'||mv.c_param96||';'||mv.c_param97||';'||mv.c_param98||';'||mv.c_param99||';'||mv.c_param100||';' FROM MyTable mv *=Step2*

Re: Query in Lucene 2.3.0

2008-02-03 Thread ajay_garg
gt; -Yonik > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Query-in-Lucene-2.3.0-tp151

Re: Query in Lucene 2.3.0

2008-02-03 Thread Yonik Seeley
On Feb 3, 2008 11:44 AM, ajay_garg <[EMAIL PROTECTED]> wrote: > Firstly, in the 2.3 optimizations, point 4 says :: > " 4. LUCENE-959: Remove synchronization in Document (yonik)". > > Well, what does that mean, since it has already been assured that multiple > adds, deletes, updates CAN be done by m

Re: Query in Lucene 2.3.0

2008-02-03 Thread ajay_garg
;>>>> has a single write.lock, this means that sitting on the CPU, we >>>>>> observe >>>>>> that >>>>>> at a particular instant, only a single thread is using the CPU, >>>>> >>>>> The write.lock is to protect

Re: Query in Lucene 2.3.0

2008-01-31 Thread Michael McCandless
le CPUs. -Yonik --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Query-in- Lucene-2.3.0-tp15175141p15198783.html Sent from the Lucene - Java Users mailing list archive

Re: Query in Lucene 2.3.0

2008-01-31 Thread ajay_garg
r instances, >>> *not* against other threads. >>> Using multiple threads on a single IndexWriter should utilize >>> multiple >>> CPUs. >>> >>> -Yonik >>> >>> --

Re: Query in Lucene 2.3.0

2008-01-31 Thread Michael McCandless
eads on a single IndexWriter should utilize multiple CPUs. -Yonik - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Query-i

Re: Query in Lucene 2.3.0

2008-01-30 Thread ajay_garg
ainst other threads. > Using multiple threads on a single IndexWriter should utilize multiple > CPUs. > > -Yonik > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail

Re: Query in Lucene 2.3.0

2008-01-30 Thread Yonik Seeley
On Jan 30, 2008 10:59 PM, ajay_garg <[EMAIL PROTECTED]> wrote: > > Thanks Mike for your directions. > > Yes, I am in fact using a single computer for my application, and your > saying that in this case, multiple threads with a single IndexWriter wll > give a better performance. Hmmm. I just wonder

Re: Query in Lucene 2.3.0

2008-01-30 Thread ajay_garg
memory at our disposal, before we are sure that there >> will be no >> "outOfMemoryException" ? If >> that is the case, does that also mean that if we are >> working with a >> single main thread only, and >> providing anything l

Re: Query in Lucene 2.3.0

2008-01-30 Thread Michael McCandless
ry at our disposal, before we are sure that there will be no "outOfMemoryException" ? If that is the case, does that also mean that if we are working with a single main thread only, and providing anything less than 16MB of memory to the JVM, then the exception would

Query in Lucene 2.3.0

2008-01-29 Thread ajay_garg
less than 16MB of memory to the JVM, then the exception would always occur ? -- View this message in context: http://www.nabble.com/Query-in-Lucene-2.3.0-tp15175141p15175141.html Sent from the Lucene - Java Users mailing list archive at Nabble.com.

Re: Query in lucene

2007-07-18 Thread Erick Erickson
When in doubt, WhitespaceAnalyzer is the most predictable. Note that it doesn't lower-case the tokens though. Depending upon your requirements, you can always pre-process your query and indexing streams and do your own lowercasing and/or character stripping. You can always create your own analyze

Query in lucene

2007-07-18 Thread WATHELET Thomas
Witch analyser I have to use to find text like this ''?