You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
2.2KB

  1. // Copyright (c) 2014 Couchbase, Inc.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package bleve
  15. import "github.com/blevesearch/bleve/mapping"
  16. // NewIndexMapping creates a new IndexMapping that will use all the default indexing rules
  17. func NewIndexMapping() *mapping.IndexMappingImpl {
  18. return mapping.NewIndexMapping()
  19. }
  20. // NewDocumentMapping returns a new document mapping
  21. // with all the default values.
  22. func NewDocumentMapping() *mapping.DocumentMapping {
  23. return mapping.NewDocumentMapping()
  24. }
  25. // NewDocumentStaticMapping returns a new document
  26. // mapping that will not automatically index parts
  27. // of a document without an explicit mapping.
  28. func NewDocumentStaticMapping() *mapping.DocumentMapping {
  29. return mapping.NewDocumentStaticMapping()
  30. }
  31. // NewDocumentDisabledMapping returns a new document
  32. // mapping that will not perform any indexing.
  33. func NewDocumentDisabledMapping() *mapping.DocumentMapping {
  34. return mapping.NewDocumentDisabledMapping()
  35. }
  36. // NewTextFieldMapping returns a default field mapping for text
  37. func NewTextFieldMapping() *mapping.FieldMapping {
  38. return mapping.NewTextFieldMapping()
  39. }
  40. // NewNumericFieldMapping returns a default field mapping for numbers
  41. func NewNumericFieldMapping() *mapping.FieldMapping {
  42. return mapping.NewNumericFieldMapping()
  43. }
  44. // NewDateTimeFieldMapping returns a default field mapping for dates
  45. func NewDateTimeFieldMapping() *mapping.FieldMapping {
  46. return mapping.NewDateTimeFieldMapping()
  47. }
  48. // NewBooleanFieldMapping returns a default field mapping for booleans
  49. func NewBooleanFieldMapping() *mapping.FieldMapping {
  50. return mapping.NewBooleanFieldMapping()
  51. }
  52. func NewGeoPointFieldMapping() *mapping.FieldMapping {
  53. return mapping.NewGeoPointFieldMapping()
  54. }