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 s....@uni-jena.de on 2012/05/14 15:13:05 UTC
Getting payloads for matching term in search result
Good day
currently I have a field defined as can be seen below:
<fieldtype name="payloads" stored="false" indexed="true" class="solr.TextField">
<analyzer>
<tokenizer class="solr.WhitespaceTokenizerFactory" />
<filter class="solr.DelimitedPayloadTokenFilterFactory" delimiter="|" encoder="identity" />
</analyzer>
</fieldtype>
<field name="payload" type="payloads" indexed="true" stored="true" />
Basically the content for that field has the following form:
"Wiedersehn|x1062y1755 macht|x1340y1758 Freude|x1502y1758"
where the stuff after the pipe is the payload data (some coordinates). What I want is to get that payload data at query time.
E.g. I search for "macht" and in the result document from solr there will be the payload data "x1340y1758".
Is there a way out of the box with solr. I have done this in plain lucene once with the TermPositions, so I know it might be possible to adopt this to solr.
Silvio
Re: Getting payloads for matching term in search result
Posted by s....@uni-jena.de.
Hello,
On 05/14/2012 10:33 PM, Mikhail Khludnev wrote:
> It's not really out-of-the-box, but not a big deal
> http://www.lucidimagination.com/blog/2010/04/18/refresh-getting-started-with-payloads/
yeah I know, but I do not know where to put/plugin the code on solrs server side. For testing purposes I have done that already with lucene directly so I thought there must be a way with solr aswell.
Regards,
Silvio
Re: Getting payloads for matching term in search result
Posted by Mikhail Khludnev <mk...@griddynamics.com>.
It's not really out-of-the-box, but not a big deal
http://www.lucidimagination.com/blog/2010/04/18/refresh-getting-started-with-payloads/
On Mon, May 14, 2012 at 5:13 PM, <s....@uni-jena.de> wrote:
> Good day
>
> currently I have a field defined as can be seen below:
>
> <fieldtype name="payloads" stored="false" indexed="true"
> class="solr.TextField">
> <analyzer>
> <tokenizer class="solr.**WhitespaceTokenizerFactory" />
> <filter class="solr.**DelimitedPayloadTokenFilterFac**tory"
> delimiter="|" encoder="identity" />
> </analyzer>
> </fieldtype>
>
> <field name="payload" type="payloads" indexed="true" stored="true" />
>
> Basically the content for that field has the following form:
>
> "Wiedersehn|x1062y1755 macht|x1340y1758 Freude|x1502y1758"
>
> where the stuff after the pipe is the payload data (some coordinates).
> What I want is to get that payload data at query time.
> E.g. I search for "macht" and in the result document from solr there will
> be the payload data "x1340y1758".
>
> Is there a way out of the box with solr. I have done this in plain lucene
> once with the TermPositions, so I know it might be possible to adopt this
> to solr.
>
> Silvio
>
--
Sincerely yours
Mikhail Khludnev
Tech Lead
Grid Dynamics
<http://www.griddynamics.com>
<mk...@griddynamics.com>
Re: Getting payloads for matching term in search result
Posted by Jack Krupansky <ja...@basetechnology.com>.
The "stored" value of your payload field does in fact have the original
payload value, albeit formatted as you have shown. Is that not sufficient?
There doesn't appear to be any Solr support for returning term payload
directly.
I see a Jira issue for adding query support, but I don’t see a Jira for
returning the payload(s) for matched terms.
-- Jack Krupansky
-----Original Message-----
From: s.hermann@uni-jena.de
Sent: Monday, May 14, 2012 9:13 AM
To: solr-user@lucene.apache.org
Subject: Getting payloads for matching term in search result
Good day
currently I have a field defined as can be seen below:
<fieldtype name="payloads" stored="false" indexed="true"
class="solr.TextField">
<analyzer>
<tokenizer class="solr.WhitespaceTokenizerFactory" />
<filter class="solr.DelimitedPayloadTokenFilterFactory" delimiter="|"
encoder="identity" />
</analyzer>
</fieldtype>
<field name="payload" type="payloads" indexed="true" stored="true" />
Basically the content for that field has the following form:
"Wiedersehn|x1062y1755 macht|x1340y1758 Freude|x1502y1758"
where the stuff after the pipe is the payload data (some coordinates). What
I want is to get that payload data at query time.
E.g. I search for "macht" and in the result document from solr there will be
the payload data "x1340y1758".
Is there a way out of the box with solr. I have done this in plain lucene
once with the TermPositions, so I know it might be possible to adopt this to
solr.
Silvio