简体   繁体   中英

custom search in aws cloudsearch

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.

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM