Closed wpjscc closed 4 months ago
If you're using the Nabu theme (which I believe you are), then yes, the search only supports the document type that's currently being viewed. However, you can modify the theme and override the search component implementation to search multiple document types if you prefer - the search component does support the ability to search multiple documents.
I don't believe using clearBootedModels
is a good idea here either - that clears all booted models and prevents model caching from working.
If you're using the Nabu theme (which I believe you are), then yes, the search only supports the document type that's currently being viewed. However, you can modify the theme and override the search component implementation to search multiple document types if you prefer - the search component does support the ability to search multiple documents.
yes,the search component does support the ability to search multiple documents。I probably didn't express it clearly, In the process of using, when I switch to the second document, the search content is actually the first document,it may have some problems. after the above method is repaired,it work for me.clearBootedModels
is not a good idea,Under research, a good method may be found.
@wpjscc could you provide an example of the issue so I can see what's happening? From the outset, I can't tell if it's a bug with the Docs or with the Search plugin.
We're going to close this for now - please comment if you wish to re-open.
fix when there are multiple documents, the search only supports one document。 because the table is
Str::snake(Str::pluralStudly(class_basename($this)))
modify to
other the
Winter\Storm\Database\Traits\ArraySource
, it only boot once , so the $arraySourceConnection is first document sqlite connect。it need to clear the boot when have other document in
Plugin.php
I think getTable is can not change when $arraySourceConnection is dynamic ,but it is not work when seach。
so modify
getTable
andclearBootedModels