lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iouli.golova...@group.novartis.com
Subject TermQuery PROBLEM!!!
Date Thu, 09 Sep 2004 12:47:11 GMT

Hello everybody and esp. Erik:)

In case search entry is empty, I'd like to generate all documents came
during the last minute
I have a filed ( created as doc.add(Field.Keyword(F_PUBLISHORT,
publishort));) containing this data in "yyyyMMddhhMM" format.

The problem is I get nothing, but I do know I have documents with for
example "200404271420" value

WHAT I DO WRONG?

When I do queries based on QueryParser (i.e. filter!=null) everything is
ok.

Thanks in advance
J.


......
           if (filter==null || filter.equals("")){
             filter=null;
             line="200404271420";
             fld = "publishort";
           }
.......


            if (filter==null){
                  query = new TermQuery(new Term(fld,line));
            }else{
                  NeisQueryParser nqp=new NeisQueryParser();
                  query = nqp.parse(line);
            }

            formated_query=query.toString();
            Sort sort=null;
            ms = getMS(); //MultiSearcher
            if (filter==null) {
                  if (sort_byscore)hits = ms.search(query,
getCurrentTimeFilter());
                  else hits = ms.search(query,getCurrentTimeFilter(),
"publishort");
            }else{
                  if (range_flag){
                        if (sort_byscore)hits = ms.search(query,
getDateFilter(),(String)null);
                        else hits = ms.search(query,getDateFilter(),sort);
                  }else{
                        if (sort_byscore)hits = ms.search(query);
                        else hits = ms.search(query,sort);
                  }
            }
            total_hitnum=hits.length();
            String logdata="";



---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message