From: Veit J. <nun...@go...> - 2010-04-21 10:23:24
|
Raghuram, in addition to Itamar's answer, you can also use Filters instead of queries, e.g. in your case the PrefixFilter. Filters have no limitations of clauses (except for the QueryFilter). But there are also some drawbacks: (1) Using filters you have no score value for hits, and (2) you have to create your own parser building the corresponding query and filter objects. Kind regards, Veit 2010/4/19 Itamar Syn-Hershko <it...@di...>: > Hi, > > This exception is by design in Lucene, and is thrown by the QueryParser IIRC > for whenever you pass more than 1024 clauses. Generally, if you receive this > execption this is due to bad design. This exception is designed to prevent > you from writing slow code. Your options are either to set the > maxClausesCount to a number higher than 1024 (there is a function for that > in the QueryParser I think), to not use the QueryParser and create the > Clauses by hand, or to redesign your code so it generates the minimum > clauses necessary. > > HTH > > Itamar. > > -----Original Message----- > From: n raghuramireddy [mailto:nra...@gm...] > Sent: Monday, April 19, 2010 8:58 PM > To: clu...@li... > Subject: Re: [CLucene-dev] Clucene search - An invalid field name was > > Hi Viet > > Actually Clucene is throwing "Too many clauses" exception for the keywords > like a*, b*, c* as these are having more than 1024 clauses. > The clauses number may grow as index grows. So please suggest me how i can > control the number of clauses. > Right now i have commented the code which checks the clauses count. > > Raghuram > > >>>Raghuram, > >>>can you execute your program in a debugger? I'd like to know where >>>this exception in the CLucene code is thrown. > >>>Kind regards, > >>>Veit > > 2010/4/13 n raghuramireddy <nra...@gm...>: >> Veit >> My query parser looks like this >> string DefaultSearchField = "TITLE"; >> QueryParser qp(DefaultSearchField, &analyzer); >> >> after this i am performing search and I have been observed that, if >> query having more than 1000 results it is throwing below error. >> "Invalid field name being used in the query string". >> Query i have given is a*, b* etc...for all these queries its throwing >> same error. >> Could you plese help me out on this. >> >> With best regards >> Raghuram >> >> >> ---------------------------------------------------------------------- >> -------------- >> Hi, >> >> do you do something else before executing the search? I ask, because I >> can't find any line in the CLucene source code where an exception with >> such a message is thrown. Neither in 0.9.21 nor in the lucene_2_3_2 >> branch. >> >> Kind regards >> >> Veit >> >> 2010/4/8 n raghuramireddy <nra...@gm...>: >>> Hi Veit >>> Thanks for your response. Search is throwing the error and the >>> default field I have given is the field which is tokenized. I am >>> indexing the Title of the document and this title is given as default >>> searchable field. >>> >>> Message: 2 >>> Date: Wed, 7 Apr 2010 21:11:20 +0200 >>> From: Veit Jahns <nun...@go...> >>> Subject: Re: [CLucene-dev] Clucene search - An invalid field name was >>> used in a query string >>> To: clu...@li... >>> Message-ID: >>> >>> <u2t...@ma...> >>> Content-Type: text/plain; charset=ISO-8859-1 >>> >>> Hi Raghuram, >>> >>> who throws this exception? The query parser parsing the query or the >>> searcher executing the query? And what does your query parser use as >>> default field? >>> >>> Kind regards, >>> >>> Veit >>> >>> 2010/4/7 n raghuramireddy <nra...@gm...>: >>>> Hi >>>> I am indexing arround 10 million records. If I search with keyword >>>> a*, Clucene is throwing following error "An invalid field name was >>>> used in a query string". Whether this error because of number of >>>> hits are more. >>>> Could any one please sugges me. >>>> >>>> Regards >>>> Raghuram >>>> >>>> -------------------------------------------------------------------- >>>> ---------- Download Intel® Parallel Studio Eval Try the new >>>> software tools for yourself. Speed compiling, find bugs proactively, >>>> and fine-tune applications for parallel performance. >>>> See why Intel Parallel Studio got high marks during beta. >>>> http://p.sf.net/sfu/intel-sw-dev >>>> _______________________________________________ >>>> CLucene-developers mailing list >>>> CLu...@li... >>>> https://lists.sourceforge.net/lists/listinfo/clucene-developers >>>> >>> >>> --------------------------------------------------------------------- >>> --------- Download Intel® Parallel Studio Eval Try the new >>> software tools for yourself. Speed compiling, find bugs proactively, >>> and fine-tune applications for parallel performance. >>> See why Intel Parallel Studio got high marks during beta. >>> http://p.sf.net/sfu/intel-sw-dev >>> _______________________________________________ >>> CLucene-developers mailing list >>> CLu...@li... >>> https://lists.sourceforge.net/lists/listinfo/clucene-developers >>> >> >> ---------------------------------------------------------------------- >> -------- Download Intel® Parallel Studio Eval Try the new >> software tools for yourself. Speed compiling, find bugs proactively, >> and fine-tune applications for parallel performance. >> See why Intel Parallel Studio got high marks during beta. >> http://p.sf.net/sfu/intel-sw-dev >> _______________________________________________ >> CLucene-developers mailing list >> CLu...@li... >> https://lists.sourceforge.net/lists/listinfo/clucene-developers >> > > ---------------------------------------------------------------------------- > -- > Download Intel® Parallel Studio Eval Try the new software tools for > yourself. Speed compiling, find bugs proactively, and fine-tune applications > for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > CLucene-developers mailing list > CLu...@li... > https://lists.sourceforge.net/lists/listinfo/clucene-developers > > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > CLucene-developers mailing list > CLu...@li... > https://lists.sourceforge.net/lists/listinfo/clucene-developers > |