lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 王巍巍 <ww.wang...@gmail.com>
Subject Re: Query any data
Date Thu, 09 Apr 2009 01:09:56 GMT
first you should change your querypaser to accept wildcard query by calling
method of QueryParser
          setAllowLeadingWildcard
then you can query like this:  fieldname:*

2009/4/9 Tim Williams <williamstw@gmail.com>

> On Wed, Apr 8, 2009 at 11:45 AM, addman <addiekong@yahoo.com> wrote:
> >
> > Hi,
> >   Is it possible to create a query to search a field for any value?  I
> just
> > need to know if the optional field contain any data at all.
>
> google for:  lucene field existence
>
> There's no way built in, one strategy[1] is to have a 'meta field'
> that contains the names of the fields the document contains.
>
> --tim
>
> [1] -
> http://www.mail-archive.com/lucene-user@jakarta.apache.org/msg07703.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>


-- 
王巍巍(Weiwei Wang)
Department of Computer Science
Gulou Campus of Nanjing University
Nanjing, P.R.China, 210093

Mobile: 86-13913310569
MSN: ww.wang.cs@gmail.com
Homepage: http://cs.nju.edu.cn/rl/weiweiwang

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message