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 Chris <ch...@gmail.com> on 2013/10/20 19:08:47 UTC

Two easy questions...

Hi,

I am new to solr & have two questions -

1. how do i get an excerpt for a huge content field (would love to show
google  like excerpts, where word searched for is highlighted)

2. If i have a field - A, is it possible to get top results with only
unique values for this field in a page...?

Thanks,
Chris

Re: Two easy questions...

Posted by Furkan KAMACI <fu...@gmail.com>.
For highlighting you can read here:
http://wiki.apache.org/solr/HighlightingParameters
For field collapsing you can read here:
http://wiki.apache.org/solr/FieldCollapsing


2013/10/20 Upayavira <uv...@odoko.co.uk>

>
>
> On Sun, Oct 20, 2013, at 06:08 PM, Chris wrote:
> > Hi,
> >
> > I am new to solr & have two questions -
> >
> > 1. how do i get an excerpt for a huge content field (would love to show
> > google  like excerpts, where word searched for is highlighted)
>
> This is possible using the highlighting component (search 'solr
> highlighting' and you'll find it.
>
> > 2. If i have a field - A, is it possible to get top results with only
> > unique values for this field in a page...?
>
> I think what you're asking is to only show one document for each value
> of your field? If this is the case, then 'field collapsing' aka 'result
> grouping' should be able to get you there. You group on your field, and
> only show on value per group.
>
> Sorry I can't give you more specifics right now, but google with the
> above keywords should get you there.
>
> Upayavira
>

Re: Two easy questions...

Posted by Upayavira <uv...@odoko.co.uk>.

On Sun, Oct 20, 2013, at 06:08 PM, Chris wrote:
> Hi,
> 
> I am new to solr & have two questions -
> 
> 1. how do i get an excerpt for a huge content field (would love to show
> google  like excerpts, where word searched for is highlighted)

This is possible using the highlighting component (search 'solr
highlighting' and you'll find it.

> 2. If i have a field - A, is it possible to get top results with only
> unique values for this field in a page...?

I think what you're asking is to only show one document for each value
of your field? If this is the case, then 'field collapsing' aka 'result
grouping' should be able to get you there. You group on your field, and
only show on value per group.

Sorry I can't give you more specifics right now, but google with the
above keywords should get you there.

Upayavira