Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- _index: "bla_bla",
- .
- .
- .
- _source: {
- domain: "somedomain.extension",
- path: "/you/know/the/path",
- lang: "en",
- keywords: ["yeah", "you", "rock", "dude", "help", "me", "good", "samaritan"]
- }
- }
- {
- "query": {
- "filtered": {
- "filter": {
- "bool": {
- "should": {
- "terms": {
- "keywords": ["stackoverflow", "rocks", "!"]
- }
- },
- "must_not": {
- "term": {
- "path": "/"
- // This works, i.e -> "lang": "en"
- }
- }
- }
- }
- }
- },
- "from": 0,
- "size": 9
- }
- {
- "query": {
- "filtered": {
- "filter": {
- "and": [
- {
- "bool": {
- "should": {
- "terms": {
- "keywords": [
- "stackoverflow",
- "rocks",
- "!"
- ]
- }
- }
- }
- },
- {
- "filter": {
- "regexp": {
- "path": ".{1,}"
- }
- }
- }
- ]
- }
- }
- },
- "from": 0,
- "size": 9
- }
- PUT /index1/test/_mapping
- {
- "test" : {
- "properties" : {
- "message" : {"type" : "string"},
- "path" : {"type" : "string", "index" : "not_analyzed"}
- }
- }
- }
- POST index1/test
- {
- "path" : "/foo/bar"
- }
- GET index1/test/_search
- {
- "query": {
- "filtered": {
- "filter": {
- "term": {
- "path": "/foo/bar"
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement