Highlight Fragment location

I'm highlighting 100 character fragments on a relatively small text field,
~2,000 characters.

Is it possible to know if the highlighted fragment contains the start of
the document? The use case is displaying "..." before the fragment if it's
not the start of the document.

Thanks for any help!

--

You could simply compare the search query with the start of the start of
the document? Or are you looking for some other way?

Best regards,

Robin Verlangen
Software engineer
*
*
W http://www.robinverlangen.nl
E robin@us2.nl

http://goo.gl/Lt7BC

Disclaimer: The information contained in this message and attachments is
intended solely for the attention and use of the named addressee and may be
confidential. If you are not the intended recipient, you are reminded that
the information remains the property of the sender. You must not use,
disclose, distribute, copy, print or rely on this e-mail. If you have
received this message in error, please contact the sender immediately and
irrevocably delete this message and any copies.

2012/9/21 Andy apryor48@gmail.com

I'm highlighting 100 character fragments on a relatively small text field,
~2,000 characters.

Is it possible to know if the highlighted fragment contains the start of
the document? The use case is displaying "..." before the fragment if it's
not the start of the document.

Thanks for any help!

--

--

Hmm, I would first have to strip the highlight tags. That doesn't sound
ideal. I wonder if the highlighter could just return the indexes of the
fragment inside the field.

Maybe this isn't a common use case.
On Sep 22, 2012 7:01 AM, "Robin Verlangen" robin@us2.nl wrote:

You could simply compare the search query with the start of the start of
the document? Or are you looking for some other way?

Best regards,

Robin Verlangen
Software engineer
*
*
W http://www.robinverlangen.nl
E robin@us2.nl

http://goo.gl/Lt7BC

Disclaimer: The information contained in this message and attachments is
intended solely for the attention and use of the named addressee and may be
confidential. If you are not the intended recipient, you are reminded that
the information remains the property of the sender. You must not use,
disclose, distribute, copy, print or rely on this e-mail. If you have
received this message in error, please contact the sender immediately and
irrevocably delete this message and any copies.

2012/9/21 Andy apryor48@gmail.com

I'm highlighting 100 character fragments on a relatively small text
field, ~2,000 characters.

Is it possible to know if the highlighted fragment contains the start of
the document? The use case is displaying "..." before the fragment if it's
not the start of the document.

Thanks for any help!

--

--

--

I think that you should ask for a feature request in github :
something like : prefix and suffix for highlight parts (with default =null)

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 22 sept. 2012 à 17:26, Andy Pryor apryor48@gmail.com a écrit :

Hmm, I would first have to strip the highlight tags. That doesn't sound ideal. I wonder if the highlighter could just return the indexes of the fragment inside the field.

Maybe this isn't a common use case.

On Sep 22, 2012 7:01 AM, "Robin Verlangen" robin@us2.nl wrote:

You could simply compare the search query with the start of the start of the document? Or are you looking for some other way?

Best regards,

Robin Verlangen
Software engineer

W http://www.robinverlangen.nl
E robin@us2.nl

Disclaimer: The information contained in this message and attachments is intended solely for the attention and use of the named addressee and may be confidential. If you are not the intended recipient, you are reminded that the information remains the property of the sender. You must not use, disclose, distribute, copy, print or rely on this e-mail. If you have received this message in error, please contact the sender immediately and irrevocably delete this message and any copies.

2012/9/21 Andy apryor48@gmail.com

I'm highlighting 100 character fragments on a relatively small text field, ~2,000 characters.

Is it possible to know if the highlighted fragment contains the start of the document? The use case is displaying "..." before the fragment if it's not the start of the document.

Thanks for any help!

--

--

--

--

Set the tags to empty strings and then you'll have the frag without and
highlighting.
Alternatively, use very simple tags, it doesn't have to be HTML.
But I wouldn't worry about playing with a few string fragments. To get
that fragment ES probably dealt with 1000s of them.

-Paul

On 9/22/2012 8:26 AM, Andy Pryor wrote:

Hmm, I would first have to strip the highlight tags. That doesn't
sound ideal. I wonder if the highlighter could just return the
indexes of the fragment inside the field.

Maybe this isn't a common use case.

On Sep 22, 2012 7:01 AM, "Robin Verlangen" <robin@us2.nl
mailto:robin@us2.nl> wrote:

You could simply compare the search query with the start of the
start of the document? Or are you looking for some other way?

Best regards,

Robin Verlangen
/Software engineer/
/
/
W http://www.robinverlangen.nl
E robin@us2.nl <mailto:robin@us2.nl>

<http://goo.gl/Lt7BC>

Disclaimer: The information contained in this message and
attachments is intended solely for the attention and use of the
named addressee and may be confidential. If you are not the
intended recipient, you are reminded that the information remains
the property of the sender. You must not use, disclose,
distribute, copy, print or rely on this e-mail. If you have
received this message in error, please contact the sender
immediately and irrevocably delete this message and any copies.



2012/9/21 Andy <apryor48@gmail.com <mailto:apryor48@gmail.com>>

    I'm highlighting 100 character fragments on a relatively small
    text field, ~2,000 characters.

    Is it possible to know if the highlighted fragment contains
    the start of the document?  The use case is displaying "..."
    before the fragment if it's not the start of the document.

    Thanks for any help!



    -- 



-- 

--

--