Examine icon indicating copy to clipboard operation
Examine copied to clipboard

Is there a way to include a wildcard in an Examine NativeQuery call?

Open jaandrews opened this issue 3 years ago • 2 comments

I've noticed that Examine strips out the wildcard indicator when using the NativeQuery method. For example, if I pass "someProperty:test*^5" to it, it gets converted to "someProperty:test^5." Is there a way to prevent the wildcard from getting stripped out? I know of a way to work around this issue, but would prefer to avoid the rework if possible.

Below are the package versions I'm using. Umbraco: 8.17.1 Examine: 1.2.0

jaandrews avatar Jan 28 '22 01:01 jaandrews

The query parser must be stripping it out. Would be interesting to create a unit test case for this and go from there. The FluentApiTests would be the place to create it, there's loads of examples there: https://github.com/Shazwazza/Examine/blob/dev/src/Examine.Test/Examine.Lucene/Search/FluentApiTests.cs

Do you think you would have anytime to setup a test case for this?

Shazwazza avatar Mar 22 '22 23:03 Shazwazza

I can probably set up a test case sometime next week. Should be pretty straightforward based on what I see in the existing tests.

jaandrews avatar Mar 25 '22 23:03 jaandrews

Had a similar issue where the the wildcard was being stripped from my Native Query. In my case it seemed to be because my search terms were wrapped in quotes:

storeName:"F*"

I removed those quotes and the wildcard worked.

mokonta avatar Feb 09 '24 16:02 mokonta

Putting quotes in a query means that it will be treated as a Phrase query and wildcards are not supported in Phrase queries.

Shazwazza avatar Feb 12 '24 17:02 Shazwazza