Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properties mapping of string fields to ES type keyword not working as expected #170

Open
temi opened this issue Jul 6, 2022 · 1 comment

Comments

@temi
Copy link

temi commented Jul 6, 2022

Expected Behavior

Class Test {
    String name
    static searchable = {
        name index: "true"
    }
}

The above code's mapped ES type should be keyword. But the code maps to text.

Actual Behaviour

The above code maps to type text.

Steps To Reproduce

No response

Environment Information

  • JDK 8

Example Application

No response

Version

4

@temi
Copy link
Author

temi commented Jul 6, 2022

The issue seems to be in the below code found in SearchableClassPropertyMapping

    boolean isAnalyzed() {
        String index = (String) mappingAttributes.index
        (index == null || index)
    }

The below table shows how the code works.

property value value value
index "true" "false" null
isAnalyzed true true true
ES type "text" "text" "text"

The code should work like below.

property value value value
index "true" "false" null
isAnalyzed false true true
ES type "keyword" "text" "text"

This was referenced Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant