Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "project": {
- "properties": {
- "id": {
- "type": "string",
- "index": "not_analyzed"
- },
- "name": {
- "type": "string",
- "index": "not_analyzed"
- },
- "createdOn": {
- "type": "date",
- "format": "date_hour_minute_second"
- },
- "lastUpdatedOn": {
- "type": "date",
- "format": "date_hour_minute_second"
- }
- }
- }
- }
- {
- "value": {
- "properties": {
- "id": {
- "type": "string",
- "index": "not_analyzed"
- },
- "projectId": {
- "type": "string",
- "index": "not_analyzed"
- },
- "translations": {
- "type": "nested",
- "index": "not_analyzed"
- },
- "createdOn": {
- "type": "date",
- "format": "date_hour_minute_second"
- },
- "lastUpdatedOn": {
- "type": "date",
- "format": "date_hour_minute_second"
- },
- "suggest": {
- "type": "completion",
- "index_analyzer": "simple",
- "search_analyzer": "simple",
- "payloads": false
- }
- }
- }
- }
- curl -XPOST http://localhost:9200/MY_APPLICATION/_suggest -d'
- {
- "suggestions": {
- "text": "val",
- "completion": {
- "field": "suggest",
- "size": "10",
- "fuzzy": {
- "fuzziness": "AUTO"
- }
- }
- }
- }'
- {
- "_shards": {
- "total": 5,
- "successful": 5,
- "failed": 0
- },
- "suggestions": [{
- "text": "el",
- "offset": 0,
- "length": 2,
- "options": [{
- "text": "value1",
- "score": 1.0
- }, {
- "text": "value2",
- "score": 1.0
- }, {
- "text": "value3",
- "score": 1.0
- }, {
- "text": "value4",
- "score": 1.0
- }, {
- "text": "value5",
- "score": 1.0
- }, {
- "text": "value6",
- "score": 1.0
- }]
- }]
- }
- curl -XPOST http://localhost:9200/MY_APPLICATION/Project2/_suggest -d'
- {
- "suggestions": {
- "text": "val",
- "completion": {
- "field": "suggest",
- "size": "10",
- "fuzzy": {
- "fuzziness": "AUTO"
- }
- }
- }
- }'
- {
- "_shards": {
- "total": 5,
- "successful": 5,
- "failed": 0
- },
- "suggestions": [{
- "text": "val",
- "offset": 0,
- "length": 2,
- "options": [{
- "text": "value3",
- "score": 1.0
- }, {
- "text": "value4",
- "score": 1.0
- }]
- }]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement