Top documents sorted by a particular field

Hi,

I want to find the top N documents in my index sorted by a particular
field, using a filter.

I find that I cannot combine a filter with a Match All query. The
filter seems to have no effect, returning the top documents in the
entire index every time regardless of the filter value.

Using the filter in conjunction with a query works.

What can I do?

Have a look

Peter.

On 25 Jan., 00:36, Frank LaRosa fr...@studyblue.com wrote:

Hi,

I want to find the top N documents in my index sorted by a particular
field, using a filter.

I find that I cannot combine a filter with a Match All query. The
filter seems to have no effect, returning the top documents in the
entire index every time regardless of the filter value.

Using the filter in conjunction with a query works.

What can I do?

BTW: Sorting != filter. The sorting is achieved with 'sort' and filter
would restrict your search results ...

On 25 Jan., 00:36, Frank LaRosa fr...@studyblue.com wrote:

Hi,

I want to find the top N documents in my index sorted by a particular
field, using a filter.

I find that I cannot combine a filter with a Match All query. The
filter seems to have no effect, returning the top documents in the
entire index every time regardless of the filter value.

Using the filter in conjunction with a query works.

What can I do?

Thanks, I seem to have gotten it to work.

On a related note -- is filtering possible on any field, or just
indexed fields?

On Jan 25, 2:25 am, Karussell tableyourt...@googlemail.com wrote:

BTW: Sorting != filter. The sorting is achieved with 'sort' and filter
would restrict your search results ...

On 25 Jan., 00:36, Frank LaRosa fr...@studyblue.com wrote:

Hi,

I want to find the top N documents in my index sorted by a particular
field, using a filter.

I find that I cannot combine a filter with a Match All query. The
filter seems to have no effect, returning the top documents in the
entire index every time regardless of the filter value.

Using the filter in conjunction with a query works.

What can I do?

Just indexed fields mainly, though you can have a script filter with a script that uses _source to load and parse the source to get a value and filter by it (which is expensive).

On Wednesday, January 25, 2012 at 7:04 PM, Frank LaRosa wrote:

Thanks, I seem to have gotten it to work.

On a related note -- is filtering possible on any field, or just
indexed fields?

On Jan 25, 2:25 am, Karussell <tableyourt...@googlemail.com (http://googlemail.com)> wrote:

BTW: Sorting != filter. The sorting is achieved with 'sort' and filter
would restrict your search results ...

On 25 Jan., 00:36, Frank LaRosa <fr...@studyblue.com (http://studyblue.com)> wrote:

Hi,

I want to find the top N documents in my index sorted by a particular
field, using a filter.

I find that I cannot combine a filter with a Match All query. The
filter seems to have no effect, returning the top documents in the
entire index every time regardless of the filter value.

Using the filter in conjunction with a query works.

What can I do?