Match numbers (articles, parts, etc.), with a prefix or appended form? (1, 01, 0001, 1000, ..) #832
Replies: 1 comment
-
Hi @francoism90 ,thanks a lot for sharing your use case, it makes sense and we can see how it could be useful. We discussed it internally with the engineering team and unfortunately it’s not a simple change. The quickest way to support this would be by adding a number normalizer in charabia. However, this would flatten all numeric sequences (e.g., 0001, 001, 000000000001) to 1, altering the current behavior. That could be counterproductive for users who rely on preserving those differences. An alternative would be to support both behaviors through an advanced setting. But that would require a broader refactor, including a new version of charabia, which is not something we can prioritize right now. I'm leaving this issue open so others can upvote or share similar needs. We’ll revisit the discussion if there’s more interest from the community. Thanks again for raising this! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
See meilisearch/meilisearch#5494 (comment)
The issue is that something you have a part number defined as 1, 01, 0001, 00001, etc. When you do search on
1
, it will only match that one article.As a workaround I insert both into the index as such (
01
being the original value`):{ part: [01, 1], }
This allows someone to find the article/part, and it's very easy to implement by trimming the zeros.
Would it be possible for Meilisearch to find both, without having to create your own trimming solution? :)
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions