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

JSON: options #715

Closed
githubmanticore opened this issue Feb 23, 2022 · 5 comments
Closed

JSON: options #715

githubmanticore opened this issue Feb 23, 2022 · 5 comments

Comments

@githubmanticore
Copy link
Contributor

Implement OPTIONS support in the JSON interface. Some users are suffering from the lack of that.

I suggest we split this task into 2:

  • prepare specification of how it will look
  • implement it
@sanikolaev
Copy link
Collaborator

Another related issue is manticoresoftware/manticoresearch-python#7
Looks like we'll need to prioritize it.

@githubmanticore
Copy link
Contributor Author

➤ Sergey Nikolaev commented:

What it can look like

{    
    "index" : "myindex", 
    "query": 
    { 
        "match_phrase": 
        { 
            "*" : "find me" 
        } 
        "options":     
        { 
            "agent_query_timeout": 100, 
            "boolean_simplify": 1, 
            "comment": "comment here", 
            "cutoff": 1000, 
            "expand_keywords": "exact", 
            "expand_keywords": 1, 
            "field_weights": 
            { 
                "title": 10, 
                "body": 3 
            }, 
            "global_idf": 1, 
            "idf": "normalized, tfidf_normalized" 
            "index_weights": 
            { 
                "idx1": 1, 
                "idx2": 2 
            }, 
            "local_df": 0, 
            "low_priority": 0, 
            "max_matches": 1000, 
            "max_query_time": 100, 
            "max_predicted_time": 100, 
            "morphology": "none", 
            "not_terms_only_allowed": 1, 
            "ranker": "expr('sum(lcs*user_weight)*1000+bm25')", 
            "rand_seed": 1234, 
            "retry_count": 5, 
            "retry_delay": 100, 
            "sort_method": "kbuffer", 
            "threads": 10, 
            "token_filter": "mylib.so:blend:@" 
        } 
    } 
} 

I.e. just direct mapping to the SQL form SELECT ... OPTIONS. Some of the options can later be implemented differently closer to the way it's done in Elasticsearch to make it easier to migrate from Elasticsearch to Manticore.

@githubmanticore
Copy link
Contributor Author

➤ Sergey Nikolaev commented:

Or it may be better to have options outside of query:

{    
    "index" : "myindex", 
    "query": 
    { 
        "match_phrase": 
        { 
            "*" : "find me" 
        } 
    }, 
    "options":     
    { 
        "agent_query_timeout": 100, 
        "boolean_simplify": 1, 
        "comment": "comment here", 
        "cutoff": 1000, 
        "expand_keywords": "exact", 
        "expand_keywords": 1, 
        "field_weights": 
        { 
            "title": 10, 
            "body": 3 
        }, 
        "global_idf": 1, 
        "idf": "normalized, tfidf_normalized" 
        "index_weights": 
        { 
            "idx1": 1, 
             "idx2": 2 
        }, 
        "local_df": 0, 
        "low_priority": 0, 
        "max_matches": 1000, 
        "max_query_time": 100, 
        "max_predicted_time": 100, 
        "morphology": "none", 
        "not_terms_only_allowed": 1, 
        "ranker": "expr('sum(lcs*user_weight)*1000+bm25')", 
        "rand_seed": 1234, 
        "retry_count": 5, 
        "retry_delay": 100, 
        "sort_method": "kbuffer", 
        "threads": 10, 
        "token_filter": "mylib.so:blend:@" 
    } 
} 

@virtadpt
Copy link

options outside of query +1, here.

@githubmanticore
Copy link
Contributor Author

➤ Ilya Kuznetsov commented:

Done in 368e7ca

boolean_simplify, low_priority and debug_no_payload were modified from

option low_priority 

to

option low_priority=1 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants