Giter Site home page Giter Site logo

Jest support for facets about jest HOT 9 CLOSED

searchbox-io avatar searchbox-io commented on July 28, 2024
Jest support for facets

from jest.

Comments (9)

ferhatsb avatar ferhatsb commented on July 28, 2024

Hi Andrea,

I'm a bit confused, given link goes to search api, but I think you are talking about the result not the query. Can you please give a detailed example about the request?

from jest.

andreaturli avatar andreaturli commented on July 28, 2024

Sorry Ferhatsb.

I was trying to say that JestResult could expose a getFacets() like SearchResponse.

        SearchRequestBuilder searchRequestBuilder = new SearchRequestBuilder(esClient).setIndices(INDEX).setTypes(TYPE);
        searchRequestBuilder.setQuery(QueryBuilders.termQuery("author", "a*"));
        searchRequestBuilder.addFacet(FacetBuilders.termsFacet("email").field("email"));

        SearchResponse searchResponse = searchRequestBuilder.execute().actionGet();
        TermsFacet facet = searchResponse.getFacets().facet(TermsFacet.class, "categoryFacet");

makes sense?

from jest.

ferhatsb avatar ferhatsb commented on July 28, 2024

Makes sense, we need to implement all kind of facets. Let me play for a while then we can discuss API detail.

from jest.

andreaturli avatar andreaturli commented on July 28, 2024

@ferhatsb thanks very much

from jest.

ferhatsb avatar ferhatsb commented on July 28, 2024

Hi Andrea,
I have created a facet branch and implemented terms facet. See below about usage.

Search search = new Search(query);
search.addIndex("terms_facet");
search.addType("document");
JestResult result = client.execute(search);
List<TermsFacet> termsFacets = result.getFacets(TermsFacet.class);

TermsFacetIntegrationTest at related branch shows all details.
Waiting for your comments.

from jest.

andreaturli avatar andreaturli commented on July 28, 2024

thanks @ferhatsb it looks really good and I will give a try later

from jest.

andreaturli avatar andreaturli commented on July 28, 2024

looks awesome! Keep going on with the other Facets and merge it asap!

Thanks!

from jest.

andreaturli avatar andreaturli commented on July 28, 2024

@ferhatsb thanks for your merge

from jest.

ferhatsb avatar ferhatsb commented on July 28, 2024

You are welcome, please keep reporting if you spot any issues.

from jest.

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.