Skip to content

Commit

Permalink
Merge branch 'develop' into feature/17/simplify-sinequa-constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
anisbhsl authored Oct 11, 2023
2 parents 1a03ec7 + f35e1c7 commit cab5208
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions pynequa/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class Sinequa(API):
base_url(str): base URL for hosted Sinequa instance
app_name(str): name of Sinequa app
query_name(str): name of search query web service
'''

def __init__(
Expand Down Expand Up @@ -404,8 +403,23 @@ def suggest_field(self):
endpoint = "suggestField"
pass

def engine_sql(self):
def engine_sql(self, sql: str, max_rows: int = 1000) -> Dict:
'''
This method runs classic SQL query on the database engine.
Args:
sql (str): Query to send
max_rows (int): Maximum number of rows a query can return (default: 1000)
Returns:
Dict: response for sql query
'''
endpoint = "engine.sql"
pass

payload = {
"sql": sql,
"maxRows": 1000,
"pretty": True,
"output": "json"
}

return self.post(endpoint=endpoint, payload=payload)

0 comments on commit cab5208

Please sign in to comment.