Giter Site home page Giter Site logo

Comments (11)

igor-alexandrov avatar igor-alexandrov commented on May 27, 2024

Instead of adding filters to composed_query method here https://github.com/toptal/chewy/blob/master/lib/chewy/query/criteria.rb#L88 it is better to add them as a separate option to body. If you want to use filter_query request then you should do this explicitly in query() method.

from chewy.

igor-alexandrov avatar igor-alexandrov commented on May 27, 2024

Here is a sentence from ElasticSearch documentation about facets:

There’s one important distinction to keep in mind. While search queries restrict both the returned documents and facet counts, search filters restrict only returned documents — but not facet counts.

from chewy.

pyromaniac avatar pyromaniac commented on May 27, 2024

Have you tried global: true for your facets (http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets.html#_scope)?

from chewy.

igor-alexandrov avatar igor-alexandrov commented on May 27, 2024

Global true will run facets on full index, but I want to run them on query, but exclude my filters.

For example, you have a shop catalog. On each category page you want to have a list of top brands for this category. But when user selects one or more brand you still have to show this list, right?

Please look how filters work in Tire. Filters and filtered query are completely different.

Sent from my iPhone

On Apr 22, 2014, at 4:32, Arkadiy Zabazhanov [email protected] wrote:

Have you tried global: true for your facets (http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets.html#_scope)?


Reply to this email directly or view it on GitHub.

from chewy.

pyromaniac avatar pyromaniac commented on May 27, 2024

And yet, could you please try global: true with facet_filter? Will it produce the same effect you need?

from chewy.

igor-alexandrov avatar igor-alexandrov commented on May 27, 2024

With facet_filter, I think, yes it will work. But it is completely not right.

When I see 'filter' method in documentation, I believe that it will produce filter, not a filtered query. If I want a filtered query, I will do this in 'query' method.

Sent from my iPhone

On Apr 22, 2014, at 7:39, Arkadiy Zabazhanov [email protected] wrote:

And yet, could you please try global: true with facet_filter? Will it produce the same effect?


Reply to this email directly or view it on GitHub.

from chewy.

pyromaniac avatar pyromaniac commented on May 27, 2024

Sure, but use suggested as workaround, please, since you need the solution ASAP.
Personally I suppose it is fucking stupid when global filter affects query only and query filter affects both query and facets :) So let me please think for a while about this case and I'll find the most suitable approach.

Thanks for turning my attention on this problem.

from chewy.

igor-alexandrov avatar igor-alexandrov commented on May 27, 2024

I will try to prepare PR today.

Sent from my iPhone

On Apr 22, 2014, at 7:54, Arkadiy Zabazhanov [email protected] wrote:

Sure, but use suggested as workaround please since you need the solution ASAP.
Personally I suppose it is fucking stupid when global filter affects query only and query filter affects both query and facets :) So let me please think for a while about this case and I'll find the most suitable approach.

Thanks for turning my attention on this problem.


Reply to this email directly or view it on GitHub.

from chewy.

taso avatar taso commented on May 27, 2024

You rock!

On Mon, Apr 21, 2014 at 8:58 PM, Igor Alexandrov
[email protected]:

I will try to prepare PR today.

Sent from my iPhone

On Apr 22, 2014, at 7:54, Arkadiy Zabazhanov [email protected]
wrote:

Sure, but use suggested as workaround please since you need the solution
ASAP.
Personally I suppose it is fucking stupid when global filter affects
query only and query filter affects both query and facets :) So let me
please think for a while about this case and I'll find the most suitable
approach.

Thanks for turning my attention on this problem.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHubhttps://github.com//issues/16#issuecomment-41001730
.

from chewy.

pyromaniac avatar pyromaniac commented on May 27, 2024

It would be awesome, thanks.

from chewy.

igor-alexandrov avatar igor-alexandrov commented on May 27, 2024

Please review PR #17

from chewy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.