How to only return applicable nested documents

I'd like to implement more relevant information in the search I'm exposing
to our users, along the lines of showing locations and other nested content
relevant to a users' filters on our 'front page' of search.

So, if I was indexing the locations of stores, I would like to be able to
do the normal "show be stores with locations within 5 miles," and have the
resulting stores' locations returned be ES be only those that match that
filter. Currently, the behavior in the simplest filter case would be to
return all stores that have one location within 5 miles, but includes all
of the stores' locations in the results.

This makes sense as a default, but how do I identify which stores were
applicable to the users' search without post-processing?

I've looked into highlighting, facets, nested documents, and filtered
queries; I've ruled out the latter as being applicable, but beyond that
it's not clear to me what would be the recommended strategy.

Suggestions?

This makes sense as a default, but how do I identify which stores were
applicable to the users' search without post-processing?

Should read: how do I identify which locations were applicable to the
users' search without post-processing

On Wednesday, May 16, 2012 4:26:02 PM UTC-7, Woody Peterson wrote:

I'd like to implement more relevant information in the search I'm exposing
to our users, along the lines of showing locations and other nested content
relevant to a users' filters on our 'front page' of search.

So, if I was indexing the locations of stores, I would like to be able to
do the normal "show be stores with locations within 5 miles," and have the
resulting stores' locations returned be ES be only those that match that
filter. Currently, the behavior in the simplest filter case would be to
return all stores that have one location within 5 miles, but includes all
of the stores' locations in the results.

This makes sense as a default, but how do I identify which stores were
applicable to the users' search without post-processing?

I've looked into highlighting, facets, nested documents, and filtered
queries; I've ruled out the latter as being applicable, but beyond that
it's not clear to me what would be the recommended strategy.

Suggestions?

You mean you use nested documents/mapping and you want to get back the
nested docs that matched? You can't do it, nested is mainly used for
filtering currently, though this feature has been asked several times and
it makes a lot of sense. One other option is to denormalize your data and
search on location documents.

On Thu, May 17, 2012 at 1:28 AM, Woody Peterson woody.peterson@gmail.comwrote:

This makes sense as a default, but how do I identify which stores were
applicable to the users' search without post-processing?

Should read: how do I identify which locations were applicable to the
users' search without post-processing

On Wednesday, May 16, 2012 4:26:02 PM UTC-7, Woody Peterson wrote:

I'd like to implement more relevant information in the search I'm
exposing to our users, along the lines of showing locations and other
nested content relevant to a users' filters on our 'front page' of search.

So, if I was indexing the locations of stores, I would like to be able to
do the normal "show be stores with locations within 5 miles," and have the
resulting stores' locations returned be ES be only those that match that
filter. Currently, the behavior in the simplest filter case would be to
return all stores that have one location within 5 miles, but includes all
of the stores' locations in the results.

This makes sense as a default, but how do I identify which stores were
applicable to the users' search without post-processing?

I've looked into highlighting, facets, nested documents, and filtered
queries; I've ruled out the latter as being applicable, but beyond that
it's not clear to me what would be the recommended strategy.

Suggestions?

Thanks for the reply, I'll implement my own post-processing. Just didn't
want to re-invent any wheels :slight_smile:

On Sunday, May 20, 2012 10:44:24 AM UTC-7, kimchy wrote:

You mean you use nested documents/mapping and you want to get back the
nested docs that matched? You can't do it, nested is mainly used for
filtering currently, though this feature has been asked several times and
it makes a lot of sense. One other option is to denormalize your data and
search on location documents.

On Thu, May 17, 2012 at 1:28 AM, Woody Peterson wrote:

This makes sense as a default, but how do I identify which stores were
applicable to the users' search without post-processing?

Should read: how do I identify which locations were applicable to the
users' search without post-processing

On Wednesday, May 16, 2012 4:26:02 PM UTC-7, Woody Peterson wrote:

I'd like to implement more relevant information in the search I'm
exposing to our users, along the lines of showing locations and other
nested content relevant to a users' filters on our 'front page' of search.

So, if I was indexing the locations of stores, I would like to be able
to do the normal "show be stores with locations within 5 miles," and have
the resulting stores' locations returned be ES be only those that match
that filter. Currently, the behavior in the simplest filter case would be
to return all stores that have one location within 5 miles, but includes
all of the stores' locations in the results.

This makes sense as a default, but how do I identify which stores were
applicable to the users' search without post-processing?

I've looked into highlighting, facets, nested documents, and filtered
queries; I've ruled out the latter as being applicable, but beyond that
it's not clear to me what would be the recommended strategy.

Suggestions?