search
search copied to clipboard
Non-indexed field in search index
Hi
I am looking to store object data on GAE search API. I didn't see any information about in google documentation. Probably, they are not given support for this implementation.
Is anyone tried storing non-indexed data in search documentations? Is there any way using with thor?
Thanks
Interesting question. I'm not aware of a way of storing arbitrary data to be returned with the search results, but which isn't indexed.
Could you use an AtomField? It's indexed, but less likely to mess up your search results since only the full literal value would match.
https://cloud.google.com/appengine/docs/python/search/fieldclasses#AtomField
David B.
If you're using the search API as a way to search entities that you also have stored in your database then it may be better to return only IDs from the search API and then retrieve the full objects from your database.
But no, the search API doesn't have any concept similar to stored fields in Lucene.
@davidwtbuxton I need to show some extra data for each object in search result page. Extra data shouldn't affect the search results. This is my case.
I was tried to exclude extra data fıelds from search query using with the google search.QueryOptions class but doesn't work for me. It was still matching from all document fields. After that, I found this package but I didn't exclude extra data fields either. Because of I am looking for non-indexed fields.
@nealedj That's could be a solution but if I retrieved the objects from the database, I can lose search matching score ordering in the search result. In addition, that solution will create a performance issue for me.
What is the best approach in this case? Is anyone got this case before?
Thank you.
I'm guessing that you're doing a full keywords search.
If you want to only search certain fields but to add more fields to the index then perhaps you could construct your own 'corpus' field on the document which contains data from only the fields you want to search. Then query by that field only (not a keywords search).