How to make case insensitive filter queries with Google App Engine?

前端 未结 2 1025
小蘑菇
小蘑菇 2020-12-03 21:17

I am working on a GAE Django Project where I have to implementing the search functionality, I have written a query and it fetches the data according to the search keyword.

2条回答
  •  粉色の甜心
    2020-12-03 22:18

    You need to store normalized versions of your data at write time, then use the same normalization to search.

    Store the data either all uppercase or all lowercase, optionally removing punctuation and changing all whitespace to a single space and maybe converting non-ASCII characters to some reasonable ASCII representation (which is, of course, trickier than it sounds.)

提交回复
热议问题