File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
src/Elasticsearch/Endpoints Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -63,15 +63,21 @@ protected function getURI()
6363 'type is required for TermVector '
6464 );
6565 }
66- if (isset ($ this ->id ) !== true ) {
67- throw new Exceptions \RuntimeException (
68- 'id is required for TermVector '
69- );
66+ if (isset ($ this ->id ) !== true && isset ( $ this -> body [ ' doc ' ]) !== true ) {
67+ throw new Exceptions \RuntimeException (
68+ 'id or doc is required for TermVectors '
69+ );
7070 }
71+
7172 $ index = $ this ->index ;
7273 $ type = $ this ->type ;
7374 $ id = $ this ->id ;
74- $ uri = "/ $ index/ $ type/ $ id/_termvector " . ($ this ->shouldUseDeprecated ? '' : 's ' );
75+
76+ $ uri = "/ $ index/ $ type/_termvector " . ($ this ->shouldUseDeprecated ? '' : 's ' );
77+
78+ if ($ id !== null ) {
79+ $ uri = "/ $ index/ $ type/ $ id/_termvector " . ($ this ->shouldUseDeprecated ? '' : 's ' );
80+ }
7581
7682 return $ uri ;
7783 }
You can’t perform that action at this time.
0 commit comments