indexquery.go 1006 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * EliasDB
  3. *
  4. * Copyright 2016 Matthias Ladkau. All rights reserved.
  5. *
  6. * This Source Code Form is subject to the terms of the Mozilla Public
  7. * License, v. 2.0. If a copy of the MPL was not distributed with this
  8. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  9. */
  10. package graph
  11. /*
  12. IndexQuery models the interface to the full text search index.
  13. */
  14. type IndexQuery interface {
  15. /*
  16. LookupPhrase finds all nodes where an attribute contains a certain
  17. phrase. This call returns a list of node keys which contain the phrase
  18. at least once.
  19. */
  20. LookupPhrase(attr, phrase string) ([]string, error)
  21. /*
  22. LookupWord finds all nodes where an attribute contains a certain word.
  23. This call returns a map which maps node key to a list of word positions.
  24. */
  25. LookupWord(attr, word string) (map[string][]uint64, error)
  26. /*
  27. LookupValue finds all nodes where an attribute has a certain value.
  28. This call returns a list of node keys.
  29. */
  30. LookupValue(attr, value string) ([]string, error)
  31. }