[opencms-dev] Lucene - Searchable fields
M Butcher
mbutcher at grcomputing.net
Wed Nov 26 07:21:01 CET 2003
"body" is the correct doc object. The body is put in an UnStored Field,
which, according to the Javadocs for Lucene:
"Constructs a String-valued Field that is tokenized and indexed, but
that is not stored in the index."
Body was implemented this way because there is no point in storing the
entire body of a document in the index when it can easily be fetched
through the OpenCms API.... I guess I should say, because _I_ couldn't
see a point in storing the entire body. You may be able to think of a
perfectly good reason. ;-)
If, for some reason, you decide you need to change from an unstored to
some other type of Field, you would need to change each of the
*Document.java classes that index bodies (e.g. no need to touch
BodylessDocument.java) and recompile (etc.). Shouldn't be bad, though,
since it only requires a one-line change per file.
Matt
Trevor Lee wrote:
> Hi,
>
> I was wondering what the searchable fields are?
>
>>From the simple_search.jsp:
> Last modified date is last_modified (ie doc.get("last_modified"))
> title is title
>
> what is the corresponding value for body?
> I've tried doc.get("body") and doc.get("text") and both seems to return
> null. But the doc.get("title") works ok for the corresponding doc object.
>
> If anyone has any ideas it would be much appreciated.
>
> Cheers
> Trevor
>
>
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev
More information about the opencms-dev
mailing list