Skip to content
This repository was archived by the owner on May 27, 2025. It is now read-only.

[#205] New custom schema for redis index#258

Merged
eddiebrissow merged 8 commits intomasterfrom
imp/205-custom-template-index-pattern
Dec 11, 2024
Merged

[#205] New custom schema for redis index#258
eddiebrissow merged 8 commits intomasterfrom
imp/205-custom-template-index-pattern

Conversation

@eddiebrissow
Copy link
Collaborator

closes #205

QE constructor now accepts pattern_index_templates option:

  1. User don't starts QE with pattern_index_templates option -> Loads custom templates from DB
  2. User starts QE with pattern_index_templates option -> Loads from DB, if the pattern_index_templates is different from loaded, ERROR
  3. User don't starts QE with pattern_index_templates option and fresh DB -> save default pattern_index_templates

Custom templates example (pattern_index_templates):

 [{
            "field":  "named_type",
            "value": "Similarity"
            "positions": [0,1],
            "arity": 2
            },
             {
            "field":  "targets[0]",
            "value": "b5459e299a5c5e8662c427f7e01b3bf1"
            "positions": [1,2]
            "arity": 3
            },
          {
            "field":  "targets[0]",
            "value": "c1db9b517073e51eb7ef6fed608ec204"
            "positions": [0,2,4,8]
            "arity": 10
            }
            
]

Copy link
Contributor

@andre-senna andre-senna left a comment

Choose a reason for hiding this comment

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

Before merging this PR, I think we need an integration test case where we test which pattern keys are actually being generated IN THE REDIS TABLE given a custom index spec.

For instance if we use this spec:

[{
            "field":  "targets[0]",
            "value": hasher.terminal_hash("Symbol", "Similarity")
            "positions": [1,2]
            "arity": 3
            },         
]

And add this expression:

(Similarity "Human" "Monkey")

I want to see the patterns actually added to the PATTERNS index in such a way that we can retrieve this expression if we make any of these queries:

(Similarity * "Monkey")
(Similarity "Human" *)
(Similarity * *)

Of course we want to vary the spec and the query format in several different cases.

@eddiebrissow
Copy link
Collaborator Author

Before merging this PR, I think we need an integration test case where we test which pattern keys are actually being generated IN THE REDIS TABLE given a custom index spec.

For instance if we use this spec:

[{
            "field":  "targets[0]",
            "value": hasher.terminal_hash("Symbol", "Similarity")
            "positions": [1,2]
            "arity": 3
            },         
]

And add this expression:

(Similarity "Human" "Monkey")

I want to see the patterns actually added to the PATTERNS index in such a way that we can retrieve this expression if we make any of these queries:

(Similarity * "Monkey")
(Similarity "Human" *)
(Similarity * *)

Of course we want to vary the spec and the query format in several different cases.

Before merging this PR, I think we need an integration test case where we test which pattern keys are actually being generated IN THE REDIS TABLE given a custom index spec.

For instance if we use this spec:

[{
            "field":  "targets[0]",
            "value": hasher.terminal_hash("Symbol", "Similarity")
            "positions": [1,2]
            "arity": 3
            },         
]

And add this expression:

(Similarity "Human" "Monkey")

I want to see the patterns actually added to the PATTERNS index in such a way that we can retrieve this expression if we make any of these queries:

(Similarity * "Monkey")
(Similarity "Human" *)
(Similarity * *)

Of course we want to vary the spec and the query format in several different cases.

Added more tests

@eddiebrissow eddiebrissow merged commit 579d187 into master Dec 11, 2024
@eddiebrissow eddiebrissow deleted the imp/205-custom-template-index-pattern branch December 11, 2024 16:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom patterns index schema

2 participants