multi-term-vectors.asciidoc 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. --
  2. :api: multi-term-vectors
  3. :request: MultiTermVectorsRequest
  4. :response: MultiTermVectorsResponse
  5. :tvrequest: TermVectorsRequest
  6. --
  7. [id="{upid}-{api}"]
  8. === Multi Term Vectors API
  9. Multi Term Vectors API allows to get multiple term vectors at once.
  10. [id="{upid}-{api}-request"]
  11. ==== Multi Term Vectors Request
  12. There are two ways to create a +{request}+.
  13. The first way is to create an empty +{request}+, and then add individual
  14. <<java-rest-high-document-term-vectors, term vectors requests>> to it.
  15. ["source","java",subs="attributes,callouts,macros"]
  16. --------------------------------------------------
  17. include-tagged::{doc-tests-file}[{api}-request]
  18. --------------------------------------------------
  19. <1> Create an empty +{request}+.
  20. <2> Add the first +{tvrequest}+ to the +{request}+.
  21. <3> Add the second +{tvrequest}+ for an artificial doc to the +{request}+.
  22. The second way can be used when all term vectors requests share the same
  23. arguments, such as index and other settings. In this case, a template
  24. +{tvrequest}+ can be created with all necessary settings set, and
  25. this template request can be passed to +{request}+ along with all
  26. documents' ids for which to execute these requests.
  27. ["source","java",subs="attributes,callouts,macros"]
  28. --------------------------------------------------
  29. include-tagged::{doc-tests-file}[{api}-request-template]
  30. --------------------------------------------------
  31. <1> Create a template +{tvrequest}+.
  32. <2> Pass documents' ids and the template to the +{request}+.
  33. include::../execution.asciidoc[]
  34. [id="{upid}-{api}-response"]
  35. ==== Multi Term Vectors Response
  36. +{response}+ allows to get the list of term vectors responses,
  37. each of which can be inspected as described in
  38. <<java-rest-high-document-term-vectors>>.
  39. ["source","java",subs="attributes,callouts,macros"]
  40. --------------------------------------------------
  41. include-tagged::{doc-tests-file}[{api}-response]
  42. --------------------------------------------------
  43. <1> Get a list of `TermVectorsResponse`