opensearch-project / OpenSearch

🔎 Open source distributed and RESTful search engine.
https://opensearch.org/docs/latest/opensearch/index/
Apache License 2.0
9.69k stars 1.79k forks source link

[Enhancement] Add Open Parameters to Flat_object Field Type #7137

Open mingshl opened 1 year ago

mingshl commented 1 year ago

Is your feature request related to a problem? Please describe. Flat objects currently do not support open parameters. Looking forward to add open parameter to increase better search results.

Describe the solution you'd like The following open parameters setting are useful to consider to add in, including normalizer, docValues, ignoreAbove, nullValue, similarity, and depthlimit.

normalizer: allow lowercase, uppercase docValues: allow to set docValues to be false ignoreAbove: allow to set if the length of a field is go above certain limit then ignore the document. nullValue: allow to set nullValue to others similarity: allow to set similarity setting depthlimit: allow to set maximum depth limitation to the JSON document

Additional context Add any other context or screenshots about the feature request here.

mingshl commented 1 year ago

Hi @lukas-vlcek, are you planning to take up this issue?

lukas-vlcek commented 1 year ago

Sure, I can take this one. Thank you!

And I am happy to take a look at the other tickets later too if they will be still available (#7136, #7138).

mingshl commented 1 year ago

I will take up https://github.com/opensearch-project/OpenSearch/issues/7136, but https://github.com/opensearch-project/OpenSearch/issues/7138 is also help wanted.

mingshl commented 1 year ago

@lukas-vlcek If you decide to work on this issue, would you like to assign yourself in this issue?

lukas-vlcek commented 1 year ago

@mingshl I can not assign myself (have no privs to do that). Can you please assign me?

mingshl commented 1 year ago

@mingshl I can not assign myself (have no privs to do that). Can you please assign me?

of course. done

ryn9 commented 9 months ago

@mingshl @lukas-vlcek

Can we please get (and maybe prioritize :) ) the addition of the "ignore_malformed" option for flat_object?

Reference: https://opensearch.org/docs/latest/field-types/

When set to true , and a document is received that is not valid json, the document will not be rejected, rather the field would ignored. IE - the field would not be indexed, and added the the "_ignored" array

This would help in situation like that referenced in the following issue, where we cannot 100% control if a valid json object is being provided. https://github.com/opensearch-project/OpenSearch/issues/8250 While this would not make the field searchable , when the option is set, at least the document would not be rejected.

kkewwei commented 4 months ago

@lukas-vlcek If you haven't started doing it yet, I'd love to try it.

lukas-vlcek commented 4 months ago

@kkewwei Feel free to jump on it. I currently do not have any spare capacity to work on it.

msfroh commented 4 months ago

@kkewwei -- Thanks a lot for picking this one up!

Once your fix is in (or maybe there's some overlap?) you might want to take a look at https://github.com/opensearch-project/OpenSearch/issues/11635.

For that one, I think we can clean up some (most?) of the query logic from FlatObjectFieldType -- a lot of it (I think) would become "If this query is qualified with a path, then delegate to valueAndPathFieldType, else delegate to valueFieldType".

kkewwei commented 4 months ago

@msfroh get it, it's a good idea, It can simply the code, I will try to implement it with you suggestion.