[SPEC] Renamed termvectors.* to termvector and mtermvectors

and fixed the YAML syntax errors
This commit is contained in:
Clinton Gormley 2014-01-21 16:30:32 +01:00
parent fe351f14e8
commit acdf2a5825
5 changed files with 100 additions and 122 deletions

View File

@ -1,6 +1,6 @@
{ {
"termvectors.get_multi_termvectors" : { "mtermvectors" : {
"documentation" : "http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-termvectors.html", "documentation" : "http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/docs-multi-termvectors.html",
"methods" : ["GET", "POST"], "methods" : ["GET", "POST"],
"url" : { "url" : {
"path" : "/_mtermvectors", "path" : "/_mtermvectors",
@ -8,18 +8,15 @@
"parts" : { "parts" : {
"index" : { "index" : {
"type" : "string", "type" : "string",
"description" : "The index in which the document resides.", "description" : "The index in which the document resides."
"required" : true
}, },
"type" : { "type" : {
"type" : "string", "type" : "string",
"description" : "The type of the document.", "description" : "The type of the document."
"required" : true
}, },
"id" : { "id" : {
"type" : "string", "type" : "string",
"description" : "The id of the document.", "description" : "The id of the document."
"required" : true
} }
}, },
"params" : { "params" : {

View File

@ -1,5 +1,5 @@
{ {
"termvectors.get_termvector" : { "termvector" : {
"documentation" : "http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-termvectors.html", "documentation" : "http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-termvectors.html",
"methods" : ["GET", "POST"], "methods" : ["GET", "POST"],
"url" : { "url" : {

View File

@ -0,0 +1,85 @@
setup:
- do:
indices.create:
index: testidx
body:
mappings:
testtype:
properties:
text:
type : "string"
term_vector : "with_positions_offsets"
- do:
index:
index: testidx
type: testtype
id: testing_document
body: {"text" : "The quick brown fox is brown."}
- do:
indices.refresh: {}
---
"Basic tests for multi termvector get":
- do:
mtermvectors:
"term_statistics" : true
"body" :
"docs":
-
"_index" : "testidx"
"_type" : "testtype"
"_id" : "testing_document"
- match: {docs.0.term_vectors.text.terms.brown.term_freq: 2}
- match: {docs.0.term_vectors.text.terms.brown.ttf: 2}
- do:
mtermvectors:
"term_statistics" : true
"body" :
"docs":
-
"_index" : "testidx"
"_type" : "testtype"
"_id" : "testing_document"
- match: {docs.0.term_vectors.text.terms.brown.term_freq: 2}
- match: {docs.0.term_vectors.text.terms.brown.ttf: 2}
- do:
mtermvectors:
"term_statistics" : true
"index" : "testidx"
"body" :
"docs":
-
"_type" : "testtype"
"_id" : "testing_document"
- match: {docs.0.term_vectors.text.terms.brown.term_freq: 2}
- match: {docs.0.term_vectors.text.terms.brown.ttf: 2}
- do:
mtermvectors:
"term_statistics" : true
"index" : "testidx"
"type" : "testtype"
"body" :
"docs":
-
"_id" : "testing_document"
- match: {docs.0.term_vectors.text.terms.brown.term_freq: 2}
- match: {docs.0.term_vectors.text.terms.brown.ttf: 2}
- do:
mtermvectors:
"term_statistics" : true
"index" : "testidx"
"type" : "testtype"
"ids" : ["testing_document"]
- match: {docs.0.term_vectors.text.terms.brown.term_freq: 2}
- match: {docs.0.term_vectors.text.terms.brown.ttf: 2}

View File

@ -1,32 +1,29 @@
setup: setup:
- do: - do:
indices.create: indices.create:
index: testidx index: testidx
body: body:
mappings: mappings:
testtype: { testtype:
"properties": { "properties":
"text": { "text":
"type" : "string", "type" : "string"
"term_vector" : "with_positions_offsets" "term_vector" : "with_positions_offsets"
}
}
}
- do: - do:
index: index:
index: testidx index: testidx
type: testtype type: testtype
id: testing_document id: testing_document
body: body:
{"text" : "The quick brown fox is brown."} "text" : "The quick brown fox is brown."
- do: - do:
indices.refresh: {} indices.refresh: {}
--- ---
"Basic tests for termvectors get": "Basic tests for termvector get":
- do: - do:
termvectors.get_termvector: termvector:
index: testidx index: testidx
type: testtype type: testtype
id: testing_document id: testing_document
@ -35,4 +32,4 @@ setup:
- match: {term_vectors.text.field_statistics.sum_doc_freq: 5} - match: {term_vectors.text.field_statistics.sum_doc_freq: 5}
- match: {term_vectors.text.terms.brown.doc_freq: 1} - match: {term_vectors.text.terms.brown.doc_freq: 1}
- match: {term_vectors.text.terms.brown.tokens.0.start_offset: 10} - match: {term_vectors.text.terms.brown.tokens.0.start_offset: 10}

View File

@ -1,101 +0,0 @@
setup:
- do:
indices.create:
index: testidx
body:
mappings:
testtype: {
"properties": {
"text": {
"type" : "string",
"term_vector" : "with_positions_offsets"
}
}
}
- do:
index:
index: testidx
type: testtype
id: testing_document
body:
{"text" : "The quick brown fox is brown."}
- do:
indices.refresh: {}
---
"Basic tests for multi termvector get":
- do:
termvectors.get_multi_termvectors:
"term_statistics" : true
"body" : {
"docs": [
{
"_index" : "testidx",
"_type" : "testtype",
"_id" : "testing_document"
}
]
}
- match: {docs.0.term_vectors.text.terms.brown.term_freq: 2}
- match: {docs.0.term_vectors.text.terms.brown.ttf: 2}
- do:
termvectors.get_multi_termvectors:
"term_statistics" : true
"body" : {
"docs": [
{
"_index" : "testidx",
"_type" : "testtype",
"_id" : "testing_document"
}
]
}
- match: {docs.0.term_vectors.text.terms.brown.term_freq: 2}
- match: {docs.0.term_vectors.text.terms.brown.ttf: 2}
- do:
termvectors.get_multi_termvectors:
"term_statistics" : true
"index" : "testidx"
"body" : {
"docs": [
{
"_type" : "testtype",
"_id" : "testing_document"
}
]
}
- match: {docs.0.term_vectors.text.terms.brown.term_freq: 2}
- match: {docs.0.term_vectors.text.terms.brown.ttf: 2}
- do:
termvectors.get_multi_termvectors:
"term_statistics" : true
"index" : "testidx"
"type" : "testtype"
"body" : {
"docs": [
{
"_id" : "testing_document"
}
]
}
- match: {docs.0.term_vectors.text.terms.brown.term_freq: 2}
- match: {docs.0.term_vectors.text.terms.brown.ttf: 2}
- do:
termvectors.get_multi_termvectors:
"term_statistics" : true
"index" : "testidx"
"type" : "testtype"
"ids" : ["testing_document"]
- match: {docs.0.term_vectors.text.terms.brown.term_freq: 2}
- match: {docs.0.term_vectors.text.terms.brown.ttf: 2}