在Azure搜索中应该对哪些列进行索引?

huangapple go评论58阅读模式
英文:

Which columns should be indexed in Azure search?

问题

根据文档的描述:

> 在Azure Cognitive Search中,搜索索引是您可搜索的内容

如果我要使整个SQL表格可搜索,是否意味着所有列都应定义为可索引的?

英文:

Help me understand the concept a little bit,

As per documentation:

> In Azure Cognitive Search, a search index is your searchable content

If I have to make entire SQL table searchable then does it mean all the columns should be defined as indexable?

答案1

得分: 0

从技术上讲,是的,您需要将所有列定义为可索引的(可搜索的),但需要注意字段数据类型是否支持搜索(目前支持Edm.StringCollection(Edm.String))。

实际上,Azure搜索甚至不允许您将字段设置为可搜索,如果该字段的数据类型既不是Edm.String也不是Collection(Edm.String)

您还应该确定您希望对其进行数据筛选的列(通常是包含布尔、日期/时间或数值数据的列),并将filterable属性设置为这些列为true。

您应该进行此操作以保持索引大小较小。

有关索引字段的更多详细信息,请参阅此链接:https://learn.microsoft.com/en-us/rest/api/searchservice/create-index#-field-definitions-.

英文:

> If I have to make entire SQL table searchable then does it mean all
> the columns should be defined as indexable?

Technically yes, you would need to make all columns indexable (searchable) caveat being the field data type supports searching (currently Edm.String and Collection(Edm.String)).

In fact, Azure Search does not even allow you to set a field as searchable if the data type of such field is not either Edm.String or Collection(Edm.String).

You should also identify the columns on which you would want to filter the data (typically columns containing boolean, date/time or numerical data) and set filterable property as true for those columns.

You should do this exercise to keep your index size small.

Please see this link for more details on index fields: https://learn.microsoft.com/en-us/rest/api/searchservice/create-index#-field-definitions-.

huangapple
  • 本文由 发表于 2023年7月4日 21:04:24
  • 转载请务必保留本文链接:https://go.coder-hub.com/76612956.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定