Class: Azure::CognitiveServices::LocalSearch::V1_0::Models::QueryContext
- Inherits:
-
Object
- Object
- Azure::CognitiveServices::LocalSearch::V1_0::Models::QueryContext
- Includes:
- MsRestAzure
- Defined in:
- lib/1.0/generated/azure_cognitiveservices_localsearch/models/query_context.rb
Overview
Defines the query context that Bing used for the request.
Constant Summary collapse
- @@discriminatorMap =
Hash.new
Instance Attribute Summary collapse
-
#_type ⇒ Object
Returns the value of attribute _type.
-
#adult_intent ⇒ Boolean
query has adult intent.
-
#alteration_display_query ⇒ String
The query string in the AlterationDisplayQuery can be html-escaped and can contain hit-highlighting characters.
-
#alteration_override_query ⇒ String
original string.
-
#altered_query ⇒ String
Bing uses the altered query string if the original query string contained spelling mistakes.
-
#ask_user_for_location ⇒ Boolean
the user’s location to provide accurate results.
- #is_transactional ⇒ Boolean
-
#original_query ⇒ String
The query string as specified in the request.
Class Method Summary collapse
-
.mapper ⇒ Object
Mapper for QueryContext class as Ruby Hash.
Instance Method Summary collapse
-
#initialize ⇒ QueryContext
constructor
A new instance of QueryContext.
Constructor Details
#initialize ⇒ QueryContext
Returns a new instance of QueryContext.
17 18 19 |
# File 'lib/1.0/generated/azure_cognitiveservices_localsearch/models/query_context.rb', line 17 def initialize @_type = "QueryContext" end |
Instance Attribute Details
#_type ⇒ Object
Returns the value of attribute _type.
21 22 23 |
# File 'lib/1.0/generated/azure_cognitiveservices_localsearch/models/query_context.rb', line 21 def _type @_type end |
#adult_intent ⇒ Boolean
query has adult intent. The value is true if the query has adult intent; otherwise, false.
50 51 52 |
# File 'lib/1.0/generated/azure_cognitiveservices_localsearch/models/query_context.rb', line 50 def adult_intent @adult_intent end |
#alteration_display_query ⇒ String
The query string in the AlterationDisplayQuery can be html-escaped and can contain hit-highlighting characters
37 38 39 |
# File 'lib/1.0/generated/azure_cognitiveservices_localsearch/models/query_context.rb', line 37 def alteration_display_query @alteration_display_query end |
#alteration_override_query ⇒ String
original string. For example, if the query string is “saling downwind”, the override query string will be “+saling downwind”. Remember to encode the query string which results in “%2Bsaling+downwind”. This field is included only if the original query string contains a spelling mistake.
45 46 47 |
# File 'lib/1.0/generated/azure_cognitiveservices_localsearch/models/query_context.rb', line 45 def alteration_override_query @alteration_override_query end |
#altered_query ⇒ String
Bing uses the altered query string if the original query string contained spelling mistakes. For example, if the query string is “saling downwind”, the altered query string will be “sailing downwind”. This field is included only if the original query string contains a spelling mistake.
32 33 34 |
# File 'lib/1.0/generated/azure_cognitiveservices_localsearch/models/query_context.rb', line 32 def altered_query @altered_query end |
#ask_user_for_location ⇒ Boolean
the user’s location to provide accurate results. If you specified the user’s location by using the X-MSEdge-ClientIP and X-Search-Location headers, you can ignore this field. For location aware queries, such as “today’s weather” or “restaurants near me” that need the user’s location to provide accurate results, this field is set to true. For location aware queries that include the location (for example, “Seattle weather”), this field is set to false. This field is also set to false for queries that are not location aware, such as “best sellers”.
61 62 63 |
# File 'lib/1.0/generated/azure_cognitiveservices_localsearch/models/query_context.rb', line 61 def ask_user_for_location @ask_user_for_location end |
#is_transactional ⇒ Boolean
64 65 66 |
# File 'lib/1.0/generated/azure_cognitiveservices_localsearch/models/query_context.rb', line 64 def is_transactional @is_transactional end |
#original_query ⇒ String
Returns The query string as specified in the request.
24 25 26 |
# File 'lib/1.0/generated/azure_cognitiveservices_localsearch/models/query_context.rb', line 24 def original_query @original_query end |
Class Method Details
.mapper ⇒ Object
Mapper for QueryContext class as Ruby Hash. This will be used for serialization/deserialization.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/1.0/generated/azure_cognitiveservices_localsearch/models/query_context.rb', line 71 def self.mapper() { client_side_validation: true, required: false, serialized_name: 'QueryContext', type: { name: 'Composite', polymorphic_discriminator: '_type', uber_parent: 'QueryContext', class_name: 'QueryContext', model_properties: { original_query: { client_side_validation: true, required: true, serialized_name: 'originalQuery', type: { name: 'String' } }, altered_query: { client_side_validation: true, required: false, read_only: true, serialized_name: 'alteredQuery', type: { name: 'String' } }, alteration_display_query: { client_side_validation: true, required: false, read_only: true, serialized_name: 'alterationDisplayQuery', type: { name: 'String' } }, alteration_override_query: { client_side_validation: true, required: false, read_only: true, serialized_name: 'alterationOverrideQuery', type: { name: 'String' } }, adult_intent: { client_side_validation: true, required: false, read_only: true, serialized_name: 'adultIntent', type: { name: 'Boolean' } }, ask_user_for_location: { client_side_validation: true, required: false, read_only: true, serialized_name: 'askUserForLocation', type: { name: 'Boolean' } }, is_transactional: { client_side_validation: true, required: false, read_only: true, serialized_name: 'isTransactional', type: { name: 'Boolean' } } } } } end |