小编Kev*_*att的帖子

mapper_parsing_exception在new elasticsearch 2.1.1版本中

问题:我已经在elasticsearch 1.7.1中创建了映射及其工作正常但在更新到2.1.1之后它会给我异常

例外

  response: '{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason"
:"analyzer on field [_all] must be set when search_analyzer is set"}],"type":"ma
pper_parsing_exception","reason":"Failed to parse mapping [movie]: analyzer on f
ield [_all] must be set when search_analyzer is set","caused_by":{"type":"mapper
_parsing_exception","reason":"analyzer on field [_all] must be set when search_a
nalyzer is set"}},"status":400}',
  toString: [Function],
  toJSON: [Function] }
Run Code Online (Sandbox Code Playgroud)

{
    "settings": {
        "number_of_shards": 1,
        "number_of_replicas": 0,
        "analysis": {
            "filter": {
                "nGram_filter": {
                    "type": "nGram",
                    "min_gram": 2,
                    "max_gram": 20,
                    "token_chars": [
                        "letter",
                        "digit",
                        "punctuation",
                        "symbol"
                    ]
                }
            },
            "analyzer": …
Run Code Online (Sandbox Code Playgroud)

node.js elasticsearch mongoosastic

6
推荐指数
1
解决办法
1534
查看次数

将css应用于第一个表

看到这个例子:https://jsfiddle.net/kevalbhatt18/w361a9hg/

当你看到小提琴第一个strach结果窗口.否则你想要看到我想要的东西.

我的问题是我创建表并应用css所有工作正常但现在我想应用border-left:1px点缀; 第一张桌子.

<div class='openDiv hide'>
    <table id="addPropertyValue1"></table>
    <table id="addPropertyValue2"></table>
    <table id="addPropertyValue3"></table>
    <table id="addPropertyValue4"></table>
    <table id="addPropertyValue5"></table>
</div>
Run Code Online (Sandbox Code Playgroud)

我和小孩子一起尝试过,但没有工作

.openDiv :first-child{
        border-left: 1px dotted;
    }
Run Code Online (Sandbox Code Playgroud)

注意:不要直接在id上应用css

.openDiv #addPropertyValue1{
    border-left: 1px dotted;
}
Run Code Online (Sandbox Code Playgroud)

想要纯css解决方案将帮助我我不希望jquery或javascript在表上应用动态类

html css

5
推荐指数
1
解决办法
2727
查看次数

ng-如果不比较ng-repeat中的$ index

在我的代码中,我想只打印 数组中的第一个单词,而我正在使用ng-if条件.

HTML:

<div ng-controller="MyCtrl">
  <div ng-repeat="Word in Words">
   <div ng-if="$index === 0" class="preview">{{Word}}- {{$index}}</div>
  </div>
</div>
Run Code Online (Sandbox Code Playgroud)

控制器:

var myApp = angular.module('myApp', []);

function MyCtrl($scope) {
    $scope.Words = ['Mon','Tue','Wed'];
}
Run Code Online (Sandbox Code Playgroud)

正如你所看到我使用ng-if="$index === 0"然后打印div值但它想要工作,不知道为什么?

示例:http://jsfiddle.net/kevalbhatt18/twvy0j4a/3/

javascript jquery angularjs

2
推荐指数
1
解决办法
7323
查看次数