Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing SearchableText from portal_catalog yields to plone.restapi warning #193

Open
sauzher opened this issue Aug 28, 2018 · 10 comments
Open

Comments

@sauzher
Copy link
Contributor

sauzher commented Aug 28, 2018

When using collective.solr 5.0.3 it is safe, as suggested, to remove SearchableText from portal_catalog and free up a lot of memory footprint.

With collective.solr 6.0a2 (as well as master branch), every search logs:
WARNING plone.restapi.search.query No such index: 'SearchableText

@tisto
Copy link
Member

tisto commented Aug 29, 2018

@sauzher can you please elaborate?

@sauzher
Copy link
Contributor Author

sauzher commented Sep 18, 2018

Doc, reports:

[using solr...] also reduce the memory footprint of your Plone instance by allowing you to remove the SearchableText, Description and Title indexes from the catalog.

After 5.0.3, c.solr uses plone.restapi to make searches but, if you do actually remove SearchableText from portal_catalog, eventlog reports WARNING plone.restapi.search.query No such index: 'SearchableText for every search.

This warning does not affect the search itself, it simply pollutes the event log without a real reason.

Perhaps it is related to plone.restapi rather than c.solr.

thanks,
alessandro.

@tisto
Copy link
Member

tisto commented Sep 18, 2018

@sauzher do you have a real URL as a pointer?

@sauzher
Copy link
Contributor Author

sauzher commented Sep 21, 2018

@tisto I apologize, but I didn't get what do you asking for :-/

@tisto
Copy link
Member

tisto commented Sep 21, 2018

@sauzher a URL that points to what you cite in "Doc, reports".

@sauzher
Copy link
Contributor Author

sauzher commented Sep 24, 2018

@tisto
Copy link
Member

tisto commented Sep 24, 2018

@sauzher thank you! :) Could you provide me with the full trace and maybe add a pointer to the code in c.solr/p.restapi that raises that warning? I am happy to help with this but I am rather busy these days...

@sauzher
Copy link
Contributor Author

sauzher commented Sep 24, 2018

It's a warning, so I've no a real traceback to provide but this:
2018-09-24 10:37:43 WARNING plone.restapi.search.query No such index: 'SearchableText'

Here it is the call done by c.solr:

and here it is where the warning is fired by plone.restapi:

A little analysis, HTH
the plone.restapi.search.query.ZCatalogCompatibleQueryAdapter.__call__() method cycles on all indexes in the query parameter and tries to adapt each with IIndexQueryParser to normalize all possible incoming values.
A missing 'SearchableText' in the catalog yields to jump this normalizing process avoiding the "could not adapt" error and logging the warning.

Now the search process still works, because the SearchableText value is always of type of a simple string and it remains unaltered in the query dict passing throught to the catalog.searchResluts(), as well as to Solr.

@tisto You're very welcome :)

@sauzher sauzher changed the title Removing SearchableText from portal_catalog yield to plone.restapi warning Removing SearchableText from portal_catalog yields to plone.restapi warning Sep 25, 2018
@sauzher
Copy link
Contributor Author

sauzher commented Jul 29, 2020

I partially solved adding a fake index to the catalog

index: SearchableText (indexed attributes: FAKE_SearchableText)

In this (dirty) way, the index is kept free of data, and the restapi is pleased to find an index with that name before committing the search.

@sauzher
Copy link
Contributor Author

sauzher commented Mar 15, 2021

Perpahs plone/plone.restapi#1087 fixes this #193 too...
I will check asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants