lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erick Erickson" <erickerick...@gmail.com>
Subject Re: Modify search results
Date Wed, 04 Jul 2007 14:20:05 GMT
First, get Luke (google lucene, luke). Use it to open the index created
by the demo (I confess I don't know if the index is a RAMdir or FSDIR.
if it's a RAMdir, find the code in the demo that opens it and change it
to an FSDir). This is important as it'll give you a clue about the
structure of an index.

What you'll see in Luke is a set of fields along the left side.
(Available fields).

In general, these fields are accessible through the Document class.
You get a document by calling IndexReader.document(#);, where
# is the *lucene* document id (see the Documents tab in Luke). These
IDs are assigned by lucene, so don't count on them being the same over
time (as in across different openings of IndexReader).

Then call document.get("field name"); to get the value stored.

You get the lucene document IDs from the Hits obect.

Best of luck trying to learn both at once....
Erick

On 7/4/07, Robert Mullin <amalafrida@gmail.com> wrote:
>
> Hoss,
>
> Thanks for your reply.  You are correct.  I am working with the Lucene
> Demo
> and trying to get some traction.  But without much luck.  Most postings on
> the list are way beyond me.  I continue to research the literature in
> order
> to find something that will bring me gently forward so that I can begin to
> understand how to use Lucene.  Not much luck so far.
>
> I am in the process of teaching myself Java, so as the days go by things
> should become more clear.
>
> But about the results that Lucene produces . . . how do I begin to look at
> and then manipulate those results?  I understand that Lucene is not an
> application, that I must develop the interface.  But I do need to
> "intercept" the results and "manipulate" it in some way . . . Hunh????\
>
> In any cas, thanks for your response.
>
> Robert
>
> On 7/3/07, Chris Hostetter <hossman_lucene@fucit.org> wrote:
> >
> >
> > : Question: how do I go about manipulating the search results?  Is it
> > possible
> > : to "intercept" the listing of HTML pages returned by the Lucene search
> > : function and modify the report it sends to the screen.
> > :
> > : Can this be as simple as adding a line to the Lucene Java code so that
> > : instead of reporting a simple chapter number, it will report the
> chapter
> >
> > please bear in mind that Lucene is not an application, it is a library
> ...
> > it will return you the results of a query as a datastructure which you
> can
> > then dispplay in your application anyway you want.  it sounds like you
> are
> > looking at a particular chunk of example client code that does a search
> > and prints some results to the screen (perhaps you are even looking at
> the
> > demo that comes with lucene and is refered to in the "getting started"
> > tutorial) ... if it is usefull to use that as a starting point for you
> > application then by all means do so, but the Lucene library doesn't know
> > (and doesn't care) how you are using the results it produces ... that's
> > entirely up to you.
> >
> >
> >
> > -Hoss
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: java-user-help@lucene.apache.org
> >
> >
>

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