Open kb0304 opened 6 years ago
@tkurz @westei I checked the solr configuration and noticed that the index holds fields text_<languageKey>
, while the API seems to operate on {text: <...>, language: <languageKey>}
.
For a Solr-noob: may you help me where this transformation is implemented?
Also, by settings parameter user
in params while querying doesn't seem to filter result based on the user while it works in Solr Admin. As @mrsimpson mentioned there seems to be a wrapper that parses the request to Solr query. Can someone please help out, how it works?
@rodrigok @hudell looping you in.
Hi @kb0304 The query is not send via json but as form-url-encoded, which has a different syntax. Try this! @mrsimpson the transformation is implemented in the Solr Handlers (which are bundled in the Docker but not yet released as OS (which will happen in the next weeks)).
@tkurz Sure, i’ll try that. Also, I am not able to filter results by user by passing ‘user’ in params. Is anything to be done on solr side to implement the same?
Please have a look at chatpal-search-solr-ext
to see the extensions we did to Solr.
I tried to replicate via postman the request that rocket chat instance makes to fetch messages. But it's not working as I am expecting it to be. Can I please get some insight into how the querying part works.
So, I put a log statement here. `query(params, callback) {
And got the following output.
http://localhost:8983/solr/chatpal/chatpal/search
{ params: { text: 'hello', language: 'en', acl: [ 'GENERAL', '95fMZdLBTwQWjK9r8', 'rocket.catxfdFdNMkTRgyCgJWD' ], type: [ 'message', 'user', 'room' ], start: 0, rows: 15 }, headers: {} }
Then I tried to replicate the same in postman, like![postman](https://user-images.githubusercontent.com/8899152/40574894-4c006740-60f8-11e8-8363-befa8a8ac983.png)
But it gives me a 400 error, ` "msg": "Unknown top-level key in JSON request : text"
Also, interestingly the following works, but it only returns![postman2](https://user-images.githubusercontent.com/8899152/40574900-73b67068-60f8-11e8-9dce-ae9c238d5d0e.png)
users
, here i have checked therows
limitThe documents exists in the solr, everything works fine when you search via Rocket Chat UI.
@tkurz @mrsimpson