vespa icon indicating copy to clipboard operation
vespa copied to clipboard

Case sensitive search not supported on index fields

Open shubh9194 opened this issue 1 year ago • 7 comments

Is your feature request related to a problem? Please describe. when we try to search the index field with some value, Vespa returns the result as case insensitive. e.g if we are doing search for fieldA="Aabc", it also returns doc that has value "aabc" for fieldA.

Describe the solution you'd like want the case sensitive result only. Docs with fieldsA=Aabc should be returned in the search

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

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

shubh9194 avatar Mar 05 '24 06:03 shubh9194

Vespa already supports case-sensitive searches using attribute fields using match:cased doc.

It's not natural to have case sensitive search against index field with text matching and linguistic integrations IMHO.

jobergum avatar Mar 05 '24 08:03 jobergum

There are use cases for it though, and what we have done recently is to make this completely the discretion of the linguistics module, but the linguistics module will have to support it and most don't. So, I think what's needed is to be able to select a linguistics module per field.

bratseth avatar Mar 05 '24 08:03 bratseth

Hi @bratseth, We are looking to enable case sensitive search on index fields only with exact match enabled. Is there a way we can achieve case sensitive search on these fields with out using a different lingiustic module since we dont need stemming and other parsing for exact field match.

107dipan avatar Aug 07 '24 11:08 107dipan

To be clear you want both of a) cased exact match, no partial match, b) on an index field not an attribute?

And if so, why can't it be an attribute?

bratseth avatar Aug 08 '24 07:08 bratseth

The only issue with using these fields as attribute is that they are stored in memory or we would need to enable paged similar to our current attributes. Since we already have a lot of attribute with paged enabled this would increase the page in out since these fields are heavily used. We can definitely try the attribute approach and liguistic as suggested but were wondering if there was any other way to enable this.

107dipan avatar Aug 08 '24 08:08 107dipan

Ok, got it. No other way right now, but it's not a lot of work to add when also doing "exact" - we can consider doing that.

bratseth avatar Aug 12 '24 08:08 bratseth