Ace-T's Blog 내 검색 [네이버 커넥트 이웃 합니다~^-^/ 요청 大 환영~~]

org.springframework.dao.DataRetrievalFailureException: Query error: [{"msg":"No primary index on keyspace lineup-test. Use CREATE PRIMARY INDEX to create one.","code":4000}]

BigDATA/couchbase 2016.03.15 16:15
[Good Comment!!, Good Discussion!!, Good Contens!!]
[ If you think that is useful, please click the finger on the bottom~^-^good~ ]
by ace-T

Error Message

org.springframework.dao.DataRetrievalFailureException: Query error: [{"msg":"No primary index on keyspace lineup-test. Use CREATE PRIMARY INDEX to create one.","code":4000}]


Query

Executing Query: SELECT v1 FROM `lineup-test` WHERE v2 = "12"


Solution

/opt/couchbase/bin/cbq

cbq>  CREATE PRIMARY INDEX ON `lineup-test` USING GSI;

{

    "requestID": "f75f9210-cf8d-4312-b469-d7dd28e866a1",

    "signature": null,

    "results": [

    ],

    "status": "success",

    "metrics": {

        "elapsedTime": "2.387898008s",

        "executionTime": "2.387748206s",

        "resultCount": 0,

        "resultSize": 0

    }

}


Data

{

  "airportname": "Seattle Tacoma Intl",

  "city": "Seattle",

  "country": "United States",

  "faa": "SEA",

  "geo": {

    "alt": 433,

    "lat": 47.449,

    "lon": -122.309306

  },

  "icao": "KSEA",

  "id": 3577,

  "type": "airport",

  "tz": "America/Los_Angeles"

}



Result

http://localhost:8080/lineup/v1/findAll?query=SEA

query : SELECT airportname FROM `lineup-test` WHERE faa = "SEA"



 


acet 박태하가 추천하는 readtrend 추천글!

설정

트랙백

댓글

:::: facebook을 이용하시는 분들은 로그인 후 아래에 코멘트를 남겨주세요 ::::

티스토리 툴바