英文:
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.String
和Collection(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-.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论