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

View File

@ -1,5 +1,5 @@
{
"termvectors.get_termvector" : {
"termvector" : {
"documentation" : "http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-termvectors.html",
"methods" : ["GET", "POST"],
"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:
- do:
indices.create:
indices.create:
index: testidx
body:
mappings:
testtype: {
"properties": {
"text": {
"type" : "string",
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."}
"text" : "The quick brown fox is brown."
- do:
indices.refresh: {}
---
"Basic tests for termvectors get":
"Basic tests for termvector get":
- do:
termvectors.get_termvector:
termvector:
index: testidx
type: testtype
id: testing_document

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}