You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The INFIELDS modifier tells it which fields to look at, but it returns either all or nothing (via NOCONTENT), but - this doesn't seem very granular compared to similar tools that allow restriction of returned fields (you might want a few key pieces of metadata, but not the heavy text data, for example).
Suggest: something likeINFIELDS, but for the values to return in addition to the document id (defaults to all if not specified). There's a question as to what to do if this proposed modifier was specified in addition to NOCONTENT... I guess either an error or NOCONTENT wins?
This is not a blocker for me, though - merely a suggestion.
BTW - not really a workaround, but you can of course retrieve the IDs and then do HMGET on them, the documents are stored simply as plain redis hashes.
@mnunberg you can take this one, it's pretty straightforward.
The API should look like RETURN {num} {field} {field}.... Having the number allows us to have field names that are reserved words, similar to INKEYS, INFIELDS, etc.
This should be reflected in the RSSearchRequest struct.
Field names must be copied to the request, because the query will be execute on a separate thread after the original caller's auto memory has finished freeing them
RETURN 0 is valid and equivalent to NOCONTENT. I wouldn't enforce a limit on the number of fields, but make sure that it's not overflowing argc of course.
Non indexed fields that are not in the schema are allowed - the schema only refers to indexing, it is perfectly okay to add documents with fields outside the schema. Just use the fields for the RM_HashGet call.
fields should be case sensitive in this context. There are places they aren't but I want to move to a fully case sensitive mode of operation, we can start here :)
When you're done, don't forget:
a. a python test.
b. document this in Commands.md
b. please add this feature to the python and java clients.
Activity
dvirsky commentedon Apr 30, 2017
Yeah, it's been in the TODO for ages, and it should really be trivial to implement :) Also generating snippets on the fly would be nice.
dvirsky commentedon Apr 30, 2017
(hint: PRs would be welcome ;) )
dvirsky commentedon Apr 30, 2017
BTW - not really a workaround, but you can of course retrieve the IDs and then do HMGET on them, the documents are stored simply as plain redis hashes.
dvirsky commentedon Jun 30, 2017
@mnunberg you can take this one, it's pretty straightforward.
The API should look like
RETURN {num} {field} {field}.... Having the number allows us to have field names that are reserved words, similar to INKEYS, INFIELDS, etc.This should be reflected in the
RSSearchRequeststruct.Field names must be copied to the request, because the query will be execute on a separate thread after the original caller's auto memory has finished freeing them
RETURN 0is valid and equivalent toNOCONTENT. I wouldn't enforce a limit on the number of fields, but make sure that it's not overflowing argc of course.Non indexed fields that are not in the schema are allowed - the schema only refers to indexing, it is perfectly okay to add documents with fields outside the schema. Just use the fields for the RM_HashGet call.
fields should be case sensitive in this context. There are places they aren't but I want to move to a fully case sensitive mode of operation, we can start here :)
When you're done, don't forget:
a. a python test.
b. document this in Commands.md
b. please add this feature to the python and java clients.
Thanks!
RediSearchGH-42: Add `RETURN` keyword to select fields within the doc…
RediSearchGH-42: Add `RETURN` keyword to select fields within the doc…
RediSearchGH-42: Add `RETURN` keyword to select fields within the doc…
RediSearchGH-42: Add `RETURN` keyword to select fields within the doc…
RediSearchGH-42: Add `RETURN` keyword to select fields within the doc…
RediSearchGH-42: Add `RETURN` keyword to select fields within the doc…
dvirsky commentedon Jul 9, 2017
Fixed in current master, will be included in next release.
GH-42: Add `RETURN` keyword to select fields within the document to r…
Replace C++ POC with Rust POC (#66)
refactor FullTermDocument* into term::Document term::Metadata term::b…
remove redefinition of VecSimIndex for msan test in redisearch (RediS…