QuestionRequest
- questionType: string · Questionrequired
The question for which an answer is requested.
- anonymousType: string · Anonymous Id
_id The anonymous visitor who made this query.
- boostType: string · Boost Fq
_fq Defines a query in Elasticsearch query-string syntax (Lucene) that can be used to boost a subset of products to the top of the ranking. For example, the query below will promote all the relevant products whose brand is
Niketo the top of recommendation list:{ "boost_fq": "brand:\"Nike\"" }For a slightly more complex example, the query below will promote the Nike products which have also been tagged as
ON SALEto the top of the ranking:{ "boost_fq": "brand:\"Nike\" AND tags:\"ON SALE\"" }It is worth mentioning that, Miso will only boost products that are relevant, and will not boost a low performance product only because it matches the boosting query.
- citeType: string · Cite End
_end The citation end marker. Example:
]or} - citeType: integer
_link Set to
1to include a link on each citation in the answer text. - citeType: string · Cite Start
_start The citation start marker. Example:
[or{ - contextType: string
_product _id The
product_idof the content the reader is viewing, for example the article on an article page. On a first question it grounds the question in that article, so a question like "are there other articles about this?" resolves to the article's actual subject instead of returning a false "I don't know". Ignored on follow-ups, where the conversation already carries the context. - fqType: string · Fq
Defines a query in Elasticsearch query-string syntax (Lucene) that can be used to restrict the superset of products to return, without influencing the overall ranking.
fqcan enable users to drill down to products with specific features based on different product attributesFor example, the query below limits the search results to only show products whose size is either
MorSand brand isNike:{"fq": "size:(\"M\" OR \"S\") AND brand:\"Nike\""}You can use
fqto apply filters against your custom attributes as well. For example, the query below limits the search results to only products whosedesignerattribute isCalvin Klein{"fq": "attributes.designer:\"Calvin Klein\""}fqcan also limit search results by numerical range. For example, the following query limits the results to products that haverating >= 4.{"fq": "rating:[4 TO *]"} - jwtType: string
_token A signed JWT identifying the reader. Use it with a publishable key from the browser, instead of sending
user_idin the body. - logType: boolean
_user _history Whether to save this question to the reader's history. Set
falsefor a per-question private mode. See the User History APIs. - metadataType: object
Any data you want stored alongside the request. Returned with the answer and available in your usage data, so you can attribute questions to a page, a placement, or a campaign.
- parentType: string · Parent Question IdFormat: uuid
_question _id The UUID of the parent question if the current question is a follow-up to a previous question.
- relatedType: array string[] · Related Resource Fl
_resource _fl A list of fields to be returned for the
related_resources. Example:['title', 'url']. - sourceType: array string[] · Source Fl
_fl A list of fields to be returned for the
sources. Any fields in uploaded product can be assigned, including fields incustom_attributes.If specificed field does not exist, that field will not be included in the result. If you use different schema for
custom_attributesacross different products, it is possible that not all returned sources has the some fields.For example, if you include
published_atandcustom_attributesinsource_fl:{ "question":"Explain Python GIL", "source_fl":["published_at", "custom_attributes.rating"] }The answer will contain
published_atfield for each source:{ "message": "success", "data": { "question": "Explain Python GIL", "question_id": "57aeb083-b943-43b1-86ab-b6108788dd50", "parent_question_id": null, "answer_stage": "Generating summary", "finished": true, "answer": "# Explain Python GIL\n\n## Why do we need the GIL? [1]\n\nThe GIL is currently an essential part of the CPython...[omitted for simplicity]", "sources": [ { "published_at": "2022-05-20T00:00:00+00:00", "custom_attributes": { "rating": 4.7 }, "product_id": "9781800207721", "title": "Multiprocessing – When a Single CPU Core Is Not Enough", "child_title": "Multiprocessing – When a Single CPU Core Is Not Enough", "child_id": "16", "snippet": "Remember the segmentation faults we saw in Chapter 11, ...[omitted]" }, { "published_at": "2015-02-26T00:00:00+00:00", "custom_attributes": { "rating": 4.3 }, "product_id": "9780134034416", "title": "5. Concurrency and Parallelism", "child_title": "5. Concurrency and Parallelism", "child_id": "12", "snippet": "<mark>Click here to view code image\n...[omitted]</mark>" }, { "published_at": "2020-04-30T00:00:00+00:00", "custom_attributes": { "rating": 3.5 }, "product_id": "9781492055013", "title": "1. Understanding Performant Python", "child_title": "1. Understanding Performant Python", "child_id": "2", "snippet": "<mark>Although it still locks Python into running ...[omitted]</mark>" }, { "published_at": "2019-11-15T00:00:00+00:00", "custom_attributes": { "rating": 4.2 }, "product_id": "9780134854717", "title": "7. Concurrency and Parallelism", "child_title": "7. Concurrency and Parallelism", "child_id": "16", "snippet": "<mark>Although Python supports multiple threads of execution...[omitted]</mark>" } ], "related_resources": [] } } - userType: string · User Hash
_hash The hash of
user_id(oranonymous_id) encrypted by your Secret API Key.user_hashis used to prevent unauthorized API access if you are making API calls with a Publishable API Key - userType: string · User Id
_id The user who made the query. For an anonymous visitor, use
anonymous_idinstead. - userenum
_type The type of user who made the query. Must be one of these values.
values- anonymous
- registered
- subscriber
- free
- paid
- internal
- yearlyType: number · Yearly Decay
_decay The yearly decay rate for the answer score.
