Code Monkey home page Code Monkey logo

Comments (8)

alexgarel avatar alexgarel commented on August 9, 2024

Yes it is supported.

Look at ElasticsearchQueryBuilder there are options to specify the field that are not analyzed (that is are of type keywords).

Those parameters can be deduced from your mapping using SchemaAnalyzer

There is a short demonstration in Quick Start

from luqum.

sefaYavuz avatar sefaYavuz commented on August 9, 2024

Thanks for your reply!

However I can't get it to work. With the following (partially) mapping for a single field:

"attributes":{
    "type":"nested",
    "properties":{
        "first_name":{
            "type":"text",
            "fields":{
                "raw":{
                    "type":"keyword"
                }
            }
        }
    }
}

As you can see I'm using a text field which is also a keyword. And fail in getting it working with the following search query: attributes.first_name.raw:<search_query>

from luqum.

alexgarel avatar alexgarel commented on August 9, 2024

Hum I don't think the schema analyzer support "fields" right now, nor the ElasticsearchQueryBuilder

This could be a good addition of course. I think it's like having an object_field, but relaxing a bit to enable calling it directly (and of course this as to be separate to be more understandable).

I may look into this, but I can't promise to have it quickly. If you are interested in making a PR it is welcome. I may guide you if you have questions after a first look at the code.

from luqum.

alexgarel avatar alexgarel commented on August 9, 2024

@sefaYavuz, if you use None for object_fields parameter of ElasticsearchQueryBuilder it should work !

from luqum.

alexgarel avatar alexgarel commented on August 9, 2024

@sefaYavuz I just pushed a commit fixing this problem.

You now have a sub_fields parameter on ElasticSearchQueryBuilder.

Could you test if it's ok on your side. If so, I would make a release.

from luqum.

sefaYavuz avatar sefaYavuz commented on August 9, 2024

@alexgarel Sorry was busy with other stuff in the meanwhile. I will test it today and will get back to you.

from luqum.

sefaYavuz avatar sefaYavuz commented on August 9, 2024

@alexgarel Works as expected! When will you be able to make it into a release?

from luqum.

alexgarel avatar alexgarel commented on August 9, 2024

@sefaYavuz released : https://pypi.org/project/luqum/0.7.5/

from luqum.

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.