-
Notifications
You must be signed in to change notification settings - Fork 222
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
bug-1921849: fix deprecated type: multi_field from super_search_fields #6736
Conversation
@@ -1718,9 +1708,8 @@ def apply_schema_properties(fields, schema): | |||
"storage_mapping": { | |||
"fields": { | |||
"full": {"index": "not_analyzed", "type": "string"}, | |||
"os_name": {"type": "string"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the only multi-field where in_database_name doesn't match the field name, which was confusing at first but I think I got the change correct here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment on line 1716 suggests this shouldn't be analyzed. However, the values are things like "Windows NT", "Mac OS X", etc and people don't search with those values--they're searching with "Windows" and "Mac". Further, the Super Search form values don't match the actual values, either.
I think you've got the right idea here in indexing the value with the string analyzer. We should remove my comment on line 1706.
Then I wondered whether we should change the data_validation_type
and query_type
values. Fun fact, for all supersearch fields, those match with the exception of addons_checked
. That has a query_type
of enum
but that should be bool
.
Weirdly, the query_type
affects whether we can use the field for histograms and data_validation_type
affects the operators you can use (which I would have expected query_type
to be used for) and how the querystring parameter values are converted.
I think given that data_validation_type
and query_type
match for all the fields, we should merge those into a single data_type
field used for all the things. That'll simplify the code a little more and make it easier to read and understand the search code.
We could do that work (merging data_validation_type
and query_type
fields and fixing addons_checked
) in a separate bug/PR. Let me know if you want me to write that up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, i'd definitely prefer to do that in a separate PR
I'm not sure how to review this. It's hard to double-check all the work and because it's applied to I think I would apply this to |
you can test locally by modifying
I'm fine applying it to |
1e80bcb
to
56dcc64
Compare
In order to test this change, we need indexing and searching working and we don't have searching working, yet. That's why I think I can't test this. If that's not true, can you walk me through how you tested indexing and searching?
In our talk last week, we talked about making the I think this PR makes additional changes to Does that plan work? If not, then I think we should bail on this PR. |
We talked about this in Zoom. Summary:
I'm good to review this now. When I'm done reviewing it, @relud will remove the changes to the @relud ^^^ I think that captures everything for this PR. Let me know if I misunderstood anything. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had one minor thing that should get fixed and thoughts on a follow-up PR to simplify data_validation_type
and query_type
.
This is good! 💯
# object, and multi_field storages don't work with doc_values=True | ||
if storage_type in ("object", "multi_field"): | ||
# object storages don't work with doc_values=True | ||
if storage_type in ("object"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if storage_type in ("object"): | |
if storage_type == "object": |
@@ -1718,9 +1708,8 @@ def apply_schema_properties(fields, schema): | |||
"storage_mapping": { | |||
"fields": { | |||
"full": {"index": "not_analyzed", "type": "string"}, | |||
"os_name": {"type": "string"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment on line 1716 suggests this shouldn't be analyzed. However, the values are things like "Windows NT", "Mac OS X", etc and people don't search with those values--they're searching with "Windows" and "Mac". Further, the Super Search form values don't match the actual values, either.
I think you've got the right idea here in indexing the value with the string analyzer. We should remove my comment on line 1706.
Then I wondered whether we should change the data_validation_type
and query_type
values. Fun fact, for all supersearch fields, those match with the exception of addons_checked
. That has a query_type
of enum
but that should be bool
.
Weirdly, the query_type
affects whether we can use the field for histograms and data_validation_type
affects the operators you can use (which I would have expected query_type
to be used for) and how the querystring parameter values are converted.
I think given that data_validation_type
and query_type
match for all the fields, we should merge those into a single data_type
field used for all the things. That'll simplify the code a little more and make it easier to read and understand the search code.
We could do that work (merging data_validation_type
and query_type
fields and fixing addons_checked
) in a separate bug/PR. Let me know if you want me to write that up.
56dcc64
to
20040be
Compare
20040be
to
c68e0ec
Compare
multi_field was removed in elasticsearch 1.0, and in 1.x is automatically translated to the new format, but starting with 5.x it throws an error
also fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1905772