Open pribadi1st opened 1 year ago
Index may be used automatically but it's also possible to force it by calling with_index
method (documentation)
For instance in your case it may look like:
Message.where('text_html.contains': "some text").with_index(:message_index)
But in this particular case using the index will not help as far as there is no any equality condition for the partition key attribute in the query. So such code will lead to a full table scan. It's how DynamoDB works.
You can find more details about the Query operation here.
@andrykonchin If I want to search case-insensitively, how should I do it? Pls help me, thanks
AFAIK DynamoDB doesn't provide means for case-insensitive String comparison. There are workarounds e.g. to store Strings in a separate attributes upper/lower-cased.
Hi, i want to ask a simple question how to set a GSI for a condition such as contains
i have a table called messages.rb
but when i do a query
the console give me a warning
this is my messages.rb and how i define the attribute