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 adfel70 <ad...@gmail.com> on 2014/12/01 18:12:13 UTC
Getting the position of a word via Solr API
Hi,
I am trying to retrieve from Solr API the position of a word from a text
field that was indexes but not stored.
I am storing the text field in an external repository and trying to do the
Solr built-in snippet function by myself, outside Solr.
Basically, all I need is to get from Solr the actual offset of the word in
the text.
I have tried 2 things:
1. Using the TermVectorComponent - Got NPE errors.
2. Using Highlighting mechanism - didn't find the needed option in the API.
If one of this actually works, please tell me how :-)
Is there another way for me to get the location/position/offset of the
searched word from a text that is not stored in Solr?
Thank you very much!!
--
View this message in context: http://lucene.472066.n3.nabble.com/Getting-the-position-of-a-word-via-Solr-API-tp4171877.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Getting the position of a word via Solr API
Posted by Michael Sokolov <ms...@safaribooksonline.com>.
I would keep trying with the highlighters. Some of them, at least, have
options to provide an external text source, although you will almost
certainly have to write some java code to get this working; extend the
highlighter you choose and supply its text from an external source.
-Mike
On 12/02/2014 08:13 AM, adfel70 wrote:
> Small update,
> I have managed making the Term Vector to work and I am getting all the words
> of the text field.
>
> The problem is that it doesn't work with several words combined, I can't
> find the offset of the needed expression starts...
>
> Any ideas anyone?
>
> Thanks!
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Getting-the-position-of-a-word-via-Solr-API-tp4171877p4172092.html
> Sent from the Solr - User mailing list archive at Nabble.com.
Re: Getting the position of a word via Solr API
Posted by adfel70 <ad...@gmail.com>.
Small update,
I have managed making the Term Vector to work and I am getting all the words
of the text field.
The problem is that it doesn't work with several words combined, I can't
find the offset of the needed expression starts...
Any ideas anyone?
Thanks!
--
View this message in context: http://lucene.472066.n3.nabble.com/Getting-the-position-of-a-word-via-Solr-API-tp4171877p4172092.html
Sent from the Solr - User mailing list archive at Nabble.com.