Skip to content

Commit

Permalink
Ensure that text search is fully ignored when running against MongoDB…
Browse files Browse the repository at this point in the history
… 2.4
  • Loading branch information
jyemin committed Jan 11, 2017
1 parent c934b6c commit 656a54b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ class FiltersFunctionalSpecification extends OperationFunctionalSpecification {

def setup() {
getCollectionHelper().insertDocuments(a, b, c)
getCollectionHelper().createIndex(new Document('y', 'text'))
}

def 'find'(Bson filter) {
Expand Down Expand Up @@ -255,6 +254,9 @@ class FiltersFunctionalSpecification extends OperationFunctionalSpecification {
@SuppressWarnings('deprecated')
@IgnoreIf({ !serverVersionAtLeast(2, 6) })
def 'should render $text'() {
given:
getCollectionHelper().createIndex(new Document('y', 'text'))

when:
def textDocument = new Document('_id', 4).append('y', 'mongoDB for GIANT ideas')
collectionHelper.insertDocuments(textDocument)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class IndexesFunctionalSpecification extends OperationFunctionalSpecification {
getCollectionHelper().listIndexes()*.get('key').contains(parse('{x : "geoHaystack", b: -1}'))
}

@IgnoreIf({ !serverVersionAtLeast(2, 4) })
@IgnoreIf({ !serverVersionAtLeast(2, 6) })
def 'text'() {
when:
getCollectionHelper().createIndex(text('x'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class ProjectionFunctionalSpecification extends OperationFunctionalSpecification

def setup() {
getCollectionHelper().insertDocuments(a)
getCollectionHelper().createIndex(new Document('y', 'text'))
}

def 'find'(Bson projection) {
Expand Down Expand Up @@ -101,6 +100,9 @@ class ProjectionFunctionalSpecification extends OperationFunctionalSpecification

@IgnoreIf({ !serverVersionAtLeast(2, 6) })
def 'metaTextScore'() {
given:
getCollectionHelper().createIndex(new Document('y', 'text'))

expect:
find(metaTextScore('score')) == [aWithScore]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class SortsFunctionalSpecification extends OperationFunctionalSpecification {

def setup() {
getCollectionHelper().insertDocuments(a, b, c)
getCollectionHelper().createIndex(new Document('y', 'text'))
}

def 'find'(Bson sort) {
Expand All @@ -66,6 +65,9 @@ class SortsFunctionalSpecification extends OperationFunctionalSpecification {

@IgnoreIf({ !serverVersionAtLeast(2, 6) })
def 'metaTextScore'() {
given:
getCollectionHelper().createIndex(new Document('y', 'text'))

expect:
find(metaTextScore('score'), new Document('score', new Document('$meta', 'textScore')))*.containsKey('score')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ class CreateIndexesOperationSpecification extends OperationFunctionalSpecificati
async << [true, false]
}

@IgnoreIf({ !serverVersionAtLeast(2, 4) })
@IgnoreIf({ !serverVersionAtLeast(2, 6) })
def 'should be able to create a textIndex'() {
given:
def operation = new CreateIndexesOperation(getNamespace(),
Expand All @@ -360,7 +360,7 @@ class CreateIndexesOperationSpecification extends OperationFunctionalSpecificati
async << [true, false]
}

@IgnoreIf({ !serverVersionAtLeast(2, 4) })
@IgnoreIf({ !serverVersionAtLeast(2, 6) })
def 'should be able to create a textIndexVersion'() {
given:
def operation = new CreateIndexesOperation(getNamespace(),
Expand Down

0 comments on commit 656a54b

Please sign in to comment.