Re: Parsing a Lucene/Solr query and adding more clauses

2013-01-16 Thread Adriano Crestani
The Flexible query parser is what you are looking for: http://lucene.apache.org/core/4_0_0/queryparser/index.html On Wed, Jan 16, 2013 at 3:46 PM, balaji.gandhi wrote: > Hi Team, > > I am trying to write a util which can parse a Lucene/Solr query and convert > into an object representation to ad

Re: Need help About Lucene Query

2012-04-15 Thread Adriano Crestani
Hi Yogesh, I bet you are indexing A as an analyzed field and its values are getting tokenized at each capital letter it finds. Try to index field A using Field.Index.NOT_ANALYZED. On Sun, Apr 15, 2012 at 3:44 AM, Yogesh patel wrote: > Hi, > > I have read apache lucene tutorial and implemented in

Re: Escaping Special Characters

2011-07-05 Thread Adriano Crestani
x27;m not getting you. escape() method takes String as an argument. > > The code snippet I am using is as follows > > *String escaped = MultiFieldQueryParser.escape(queryString); > Query query1 = parser.parse(escaped); > TopDocs results = searcher.search(query1); > > *Please po

Re: Escaping Special Characters

2011-07-04 Thread Adriano Crestani
Hi Govind, escape() method should only be used to escape term, not the query itself. If the user is entering the query, it's his responsibility to escape the query. On Mon, Jul 4, 2011 at 4:21 AM, govind bhardwaj wrote: > Hi, > > I am using Lucene version 3.1 > Previously I had trouble regardin

Re: Bug in BrazilianAnalyzer?

2011-05-11 Thread Adriano Crestani
Hi, I think you forgot to attach the JUnit. On Wed, May 11, 2011 at 10:04 AM, wrote: > Hi, > I did a test to understand the use of '*'and '?'. > If I use StandardAnalyzer I have expected results by if a use > BrazilianAnalyzer I have a mistake result. > Please, where is my mistake? Junit is

Re: Query parse errors for dashes in Lucene (3.0.3)

2011-01-24 Thread Adriano Crestani
It's valid syntax error, since - is the exclusion operator, so the QP expects a term, phrase, parenthesis, etc after that. On Mon, Jan 24, 2011 at 5:05 PM, Andrew Kane wrote: > Shouldn't these two queries be fine? (from TREC million query track). > Should this be entered as a bug? > > Thanks,

Re: 3.0.3 Contrib Query Parser : Custom Field Name Builder

2011-01-07 Thread Adriano Crestani
I created a JIRA to fix this problem: https://issues.apache.org/jira/browse/LUCENE-2855 On Sat, Jan 8, 2011 at 1:32 AM, Adriano Crestani wrote: > Hi Christopher, > > Thanks for raising this problem, I always thought a little bit strange to > use CharSequence as map key. Then a just

Re: 3.0.3 Contrib Query Parser : Custom Field Name Builder

2011-01-07 Thread Adriano Crestani
Hi Christopher, Thanks for raising this problem, I always thought a little bit strange to use CharSequence as map key. Then a just did a little bit of research and found this on CharSequence javadoc: "This interface does not refine the general contracts of the equals

Re: How to combine QueryParser and Wildcard search

2010-11-19 Thread Adriano Crestani
(); ((QueryNodeProcessorPipeline) qp.getQueryNodeProcessor()).add(new MyQueryNodeProcessor()); // qp is ready for use Please, let me know if you have any question about how to implement your own QueryNodeProcessor. Regards, Adriano Crestani On Fri, Nov 19, 2010 at 9:40 AM, Israel Tsadok wrote: > I&#x

Re: How to export lucene index to a simple text file?

2010-09-22 Thread Adriano Crestani
> Saving the index in text format would also be a fun codec (in 4.0) to create > :) A codec like that would be welcome :) On Wed, Sep 22, 2010 at 5:31 AM, Michael McCandless wrote: > Saving the index in text format would also be a fun codec (in 4.0) to create > :) > > Ie, the codec would be re

Re: recommendation for deprecated StandardTokenizer.next() method?

2010-06-03 Thread Adriano Crestani
ucene/analysis/TokenStream.html Regards, Adriano Crestani On Thu, Jun 3, 2010 at 3:52 PM, allasso wrote: > > Hello, > > Does anyone have a recommendation for implementing the function previously > done by the deprecated StandardTokenizer.next() method? > > and/or, can anyone

Re: how to reuse a tokenStream?

2010-05-29 Thread Adriano Crestani
reader.reset(); tokenizer.reset(reader); // consume it again Best Regards, Adriano Crestani On Sat, May 29, 2010 at 1:43 AM, Li Li wrote: > I want to implement an analyzer which use WhitespaceAnalyzer first > then my tokenFilter. But my filter need not global information of > token such as how m

Re: Questions about the new query parser framework

2010-05-02 Thread Adriano Crestani
parentheses. StandardSyntaxParser generate and different query node trees for these two queries, one with GroupQueryNode and the other without. However, after the query node tree is sent through the StandardQueryNodeProcessorPipeline, the query node tree is optimized and usually GroupQueryNode(s) are remov

Re: Is the new Lucene Query parser framework compatibility with older lucene versions ?

2010-04-28 Thread Adriano Crestani
Hi Kannan, contrib-queryparser code is not compatible with 2.4 release because it uses the Attribute API, which was only introduced in 2.9. Regards, Adriano Crestani On Wed, Apr 28, 2010 at 8:44 PM, kannan chandrasekaran wrote: > Hi All, > > I have a question regarding the new Luc

Re: SpanQuery for Terms at same position

2009-11-22 Thread Adriano Crestani
You are right Paul, 0 would not work, probably something less than zero, as Paul suggested. Give it a try and tell us if it worked ; ) On Sun, Nov 22, 2009 at 9:50 AM, Paul Elschot wrote: > Op zondag 22 november 2009 04:47:50 schreef Adriano Crestani: > > Hi, > > > > I didn&

Re: SpanQuery for Terms at same position

2009-11-21 Thread Adriano Crestani
Hi, I didn't test, but you might want to try SpanNearQuery and set slop to zero. Give it a try and let me know if it worked. Regards, Adriano Crestani On Thu, Nov 19, 2009 at 7:28 PM, Christopher Tignor wrote: > Hello, > > I would like to search for all documents that contain b

Re: querying multi-value fields

2009-10-12 Thread Adriano Crestani
Hi Eric, To achieve what you want, do not tokenize the values you query/add to this field. On Mon, Oct 12, 2009 at 4:05 PM, Angel, Eric wrote: > I have documents that store multiple values in some fields (using the > document.add(new Field()) with the same field name). Here's what a > typical

Re: Help needed figuring out reason for maxClauseCount is set to 1024 error

2009-10-07 Thread Adriano Crestani
Hi, Can you provide to us the exception stack trace? Thanks, Adriano Crestani On Wed, Oct 7, 2009 at 7:42 PM, mitu2009 wrote: > > Hi, > > I've two sets of search indexes. TestIndex (used in our test environment) > and ProdIndex(used in PRODUCTION environment). Lucene s

Re: Generating Query

2009-08-12 Thread Adriano Crestani
Try this: BooleanQuery b1 = new BooleanQuery(); b1.add(new TermQuery(new Term("url", "news")), BooleanClause.Occur.MUST); b1.add(new TermQuery(new Term("url", "politics")), BooleanClause.Occur.MUST); b1.setBoost(1.5f); BooleanQuery b2 = new BooleanQuery(); b2.add(n

Re: Nightly build link is broken

2009-08-05 Thread Adriano Crestani
ra is working on fixing it... > > Mike > > On Wed, Aug 5, 2009 at 2:10 PM, Adriano > Crestani wrote: > > The new link also does not work. Is it working for you? > > > > On Wed, Aug 5, 2009 at 11:06 AM, Adriano Crestani < > adrianocrest...@gmail.com > >> wrote:

Re: Nightly build link is broken

2009-08-05 Thread Adriano Crestani
The new link also does not work. Is it working for you? On Wed, Aug 5, 2009 at 11:06 AM, Adriano Crestani wrote: > Now I see it was in the news session on the main page: 3 January 2007 - > Nightly Source builds > available<http://lucene.apache.org/java/docs/#3+January+2007+-+Ni

Re: Nightly build link is broken

2009-08-05 Thread Adriano Crestani
> > Mike > > On Tue, Aug 4, 2009 at 5:40 PM, Adriano > Crestani wrote: > > Hi, > > > > I was trying to download a nightly build jar, so I went to Lucene website > > and clicked on the link that redirected to: > > > > http://lucene.zones.apache.org:

Nightly build link is broken

2009-08-04 Thread Adriano Crestani
;. Is the link broken or the server is down? Thanks, Adriano Crestani

Re: Unable to find: org.apache.lucene.index.memory.AnalyzerUtil

2009-07-16 Thread Adriano Crestani
Hi, The package org.apache.lucene.index.memory belongs to a contrib jar. Try to add lucene-memory-.jar to your classpath. Regards, Adriano Crestani On Thu, Jul 16, 2009 at 9:23 PM, prashant ullegaddi < prashullega...@gmail.com> wrote: > Hi > > I'm unable to find this class