You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Norbert Hartl <no...@hartl.name> on 2009/01/11 11:32:57 UTC
Getting only fields that match
Hi,
I'm new to solr. I toyed around a little with solr
while searching for a search server with lucene. I
saw a lot of things that can be done with solr but
I missed one feature that I need.
I like the search result to include only the fields
that matched the search. Is this possible? I only
saw the field spec where you can have a certain set
of fields or all.
regards,
Norbert
Re: Getting only fields that match
Posted by Otis Gospodnetic <ot...@yahoo.com>.
Norbert,
Other than though "explain query" method I don't think we have any mechanism to figure out which field(s) exactly a query matched.
Otis
--
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch
----- Original Message ----
> From: Norbert Hartl <no...@hartl.name>
> To: solr-user@lucene.apache.org
> Sent: Sunday, January 11, 2009 6:41:12 PM
> Subject: Re: Getting only fields that match
>
> Hi,
>
> On Sun, 2009-01-11 at 17:07 +0530, Shalin Shekhar Mangar wrote:
> > On Sun, Jan 11, 2009 at 4:02 PM, Norbert Hartl wrote:
> >
> > >
> > > I like the search result to include only the fields
> > > that matched the search. Is this possible? I only
> > > saw the field spec where you can have a certain set
> > > of fields or all.
> >
> >
> > Are you looking for highlighting (snippets)?
> >
> > http://wiki.apache.org/solr/HighlightingParameters
> >
> > A Field can be indexed (searchable) or stored (retrievable) or both. When
> > you make a query to Solr, you yourself specify which fields it needs to
> > search on. If they are stored, you can ask to retrieve those fields only.
> > Not sure if that answers your question.
> >
> no, it doesn't. I want to have the following:
>
> Doc1
> field one = super test text
> field two = something
> field three = another thing
>
> Doc2
> field one = even other stuff
> field zzz = this is a test
>
> Searching for test I want to retrieve
>
> Doc1
> field one
> Doc2
> field zzz
>
> So I want only retrieve the fields that match the search
> (test in this case)
>
> I hope this makes it clear.
>
> Norbert
Re: Getting only fields that match
Posted by Norbert Hartl <no...@hartl.name>.
Hi,
On Sun, 2009-01-11 at 17:07 +0530, Shalin Shekhar Mangar wrote:
> On Sun, Jan 11, 2009 at 4:02 PM, Norbert Hartl <no...@hartl.name> wrote:
>
> >
> > I like the search result to include only the fields
> > that matched the search. Is this possible? I only
> > saw the field spec where you can have a certain set
> > of fields or all.
>
>
> Are you looking for highlighting (snippets)?
>
> http://wiki.apache.org/solr/HighlightingParameters
>
> A Field can be indexed (searchable) or stored (retrievable) or both. When
> you make a query to Solr, you yourself specify which fields it needs to
> search on. If they are stored, you can ask to retrieve those fields only.
> Not sure if that answers your question.
>
no, it doesn't. I want to have the following:
Doc1
field one = super test text
field two = something
field three = another thing
Doc2
field one = even other stuff
field zzz = this is a test
Searching for test I want to retrieve
Doc1
field one
Doc2
field zzz
So I want only retrieve the fields that match the search
(test in this case)
I hope this makes it clear.
Norbert
Re: Getting only fields that match
Posted by Norbert Hartl <no...@hartl.name>.
On Sun, 2009-01-11 at 17:07 +0530, Shalin Shekhar Mangar wrote:
> On Sun, Jan 11, 2009 at 4:02 PM, Norbert Hartl <no...@hartl.name> wrote:
>
> >
> > I like the search result to include only the fields
> > that matched the search. Is this possible? I only
> > saw the field spec where you can have a certain set
> > of fields or all.
>
>
> Are you looking for highlighting (snippets)?
>
> http://wiki.apache.org/solr/HighlightingParameters
>
> A Field can be indexed (searchable) or stored (retrievable) or both. When
> you make a query to Solr, you yourself specify which fields it needs to
> search on. If they are stored, you can ask to retrieve those fields only.
> Not sure if that answers your question.
>
Having another look on your proposal I can see you might
be right :) Seems to me to be most doable approach by now, too.
thanks,
Norbert
Re: Getting only fields that match
Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Sun, Jan 11, 2009 at 4:02 PM, Norbert Hartl <no...@hartl.name> wrote:
>
> I like the search result to include only the fields
> that matched the search. Is this possible? I only
> saw the field spec where you can have a certain set
> of fields or all.
Are you looking for highlighting (snippets)?
http://wiki.apache.org/solr/HighlightingParameters
A Field can be indexed (searchable) or stored (retrievable) or both. When
you make a query to Solr, you yourself specify which fields it needs to
search on. If they are stored, you can ask to retrieve those fields only.
Not sure if that answers your question.
--
Regards,
Shalin Shekhar Mangar.