Azure搜索服务搜索整数

时间:2018-07-06 07:40:08

标签: azure search odata azure-search azure-search-.net-sdk

提供一个简单的索引:

<div class="container">
    <div class="inner-w">        
        <div class="block center">Center</div>  
        <div class="block left">Left</div>
        <div class="block right">Right</div>
    </div>
</div> <!-- .container -->

* {
    box-sizing: border-box;
}

.container {
    width: 100%;
    float: left;
    overflow: hidden; /* should be clearfix instead */
}

.container .inner-w {
    position: relative;
    max-width: 50em;
    margin-right: auto;
    margin-left: auto;
    overflow: hidden; /* should be clearfix instead */
}

.block {
    width: 100%;
    float: left;
    min-height: 10em; /* just for show */
}

@media (min-width: 50em) {  

    .center {
        width: 50%;
        position: relative;
        left: 25%;
    }

    .left {
        position: absolute;
        top: 0;
        left: 0;
        width: 25%;
    }

    .right {
        float: right;
        width: 25%;    
    }
} /* end break-point */















/* just for show */
.container {
    border: 1px solid blue;
}

.container .inner-w {
    border: 1px solid orange;
}

.block {
    border: 1px solid red;
    min-height: 10em; /* just for show */
    padding: 1em;
}

如何搜索与SomeNumber int完全匹配的数字?

public partial class SomeIndex { [Key] [IsFilterable] public string Id{ get; set; } [IsSearchable, IsFilterable, IsSortable] public string Name{ get; set; } [IsFilterable, IsSortable] public int SomeNumber { get; set; } 在这里不适用。

任何建议表示赞赏。谢谢。

1 个答案:

答案 0 :(得分:2)

您可以使用过滤器。 “ eq”效果完美。

过滤器查询将为“字段名称 eq 数字”

唯一的限制是该字段必须是可过滤的