lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless" <luc...@mikemccandless.com>
Subject Re: Document.getField(field).stringValue() behavior
Date Sat, 01 Dec 2007 09:37:40 GMT

If you call .stringValue() you should get just that string?

(You are now calling .toString()).

Mike

"Cauvery Developer" <kaveriopensource@gmail.com> wrote:
> Hi,
> I am working with demo and I am displaying the search results as :
> 
> Hits ht = is.search(q);
> for (int i = 0; i <= ht.length(); i++) {
>      Document hitDoc = ht.doc(i);
>      queryResult.add(hitDoc.getField("name").toString() + "~"
>      + hitDoc.getField("date").toString());
> System.out.println(queryResult) ;
> }
> 
> I get the following output :
> 
> stored/uncompressed,indexed<name:HWORLD>~stored/uncompressed,indexed<date:Fri
> Nov 30 23:43:50 PST 2007>
> 
> The result "HWORLD" and "Fri Nov 30 23:43:50 PST 2007" is correct. But, I
> was under the impression that the output would simply be
> 
> HWORLD~Fri Nov 30 23:43:50 PST 2007
> 
> Therefore, should the output of Document.getField(field).stringValue()
> behavior be further parsed to get directly to the term that was added  ?
> 
> Thanks and regards,
> Nags

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


Mime
View raw message