Reputation: 1409
I am trying to create a query for amazon cloudsearch but haven't had any luck finding it in the documentation and other sources.
The Query would be something like a longest prefix match If my data contains the following numbers
phone_number
123456
123442
423533
233545
265754
I can query for a string of any length such as 12345678990 It should return the number with the largest number of prefix digits matching. In this case it should return 123456.
Upvotes: 0
Views: 105
Reputation: 2214
You should be able to add the partial values to an OR search and since the record containing the most digits will match the most OR conditions it SHOULD be ranked the highest.
Here is what an OR looks like:
(12345678990|1234567899|123456789|12345678|1234567|123456|12345|1234|123|12|1)
Upvotes: 0