Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add filtering by tags for InMemoryDocumentStore #108

Merged
merged 5 commits into from
May 14, 2020
Merged

Add filtering by tags for InMemoryDocumentStore #108

merged 5 commits into from
May 14, 2020

Conversation

skirdey
Copy link
Contributor

@skirdey skirdey commented May 13, 2020

Storing and filtering tags in InMemory store. Adding meta obj to InMemory store.

@tholor tholor requested a review from tanaysoni May 13, 2020 07:33
@tholor tholor added the type:feature New feature or request label May 13, 2020
haystack/database/memory.py Outdated Show resolved Hide resolved
test/test_in_memory_store.py Show resolved Hide resolved
… to support {many tags with many differnt values}. Adding unit tests
@skirdey skirdey requested a review from tanaysoni May 13, 2020 20:56
@@ -38,9 +38,14 @@ class Document(BaseModel):
question: Optional[str] = Field(None, description="Question text for FAQs.")
query_score: Optional[float] = Field(None, description="Elasticsearch query score for a retrieved document")
meta: Optional[Dict[str, Any]] = Field(None, description="")
tags: Optional[Dict[str, Any]] = Field(None, description="Tags that allow filtering of the data")

def __getitem__(self, item):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we remove __get_item__() altogether? I think we can access PyDantic properties directly, eg., document.text and document.meta.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

haystack/database/base.py Show resolved Hide resolved
@skirdey skirdey requested a review from tanaysoni May 14, 2020 20:07
@tanaysoni
Copy link
Contributor

Thanks again @skirdey for the PR. It looks good-to-go!

@tanaysoni tanaysoni changed the title Adding meta to document in InMemory store. Adding filtering by tags i… Add filtering by tags for InMemory Store May 14, 2020
@tanaysoni tanaysoni changed the title Add filtering by tags for InMemory Store Add filtering by tags for InMemoryDocumentStore May 14, 2020
@tanaysoni tanaysoni merged commit 72a3b70 into deepset-ai:master May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants