-
Notifications
You must be signed in to change notification settings - Fork 3
added search funcionality #35
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
Conversation
| return dataManager.getAutocompleteResults(query, params.toTypedArray()) | ||
| } | ||
|
|
||
| fun search(text: String, vararg facets: Pair<String, List<String>>, page: Int? = null, perPage: Int? = null, groupId: Int? = null): Observable<ConstructorData<SearchResponse>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use vararg for facets?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so you can define define multiple, I believe that it was requirement
| return dataManager.getAutocompleteResults(query, params.toTypedArray()) | ||
| } | ||
|
|
||
| fun search(text: String, vararg facets: Pair<String, List<String>>, page: Int? = null, perPage: Int? = null, groupId: Int? = null): Observable<ConstructorData<SearchResponse>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rename search to getSearchResults to match getAutocompleteResults?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
| fun search(text: String, vararg facets: Pair<String, List<String>>, page: Int? = null, perPage: Int? = null, groupId: Int? = null): Observable<ConstructorData<SearchResponse>> { | ||
| val sessionId = preferenceHelper.getSessionId(sessionIncrementEventHandler) | ||
| val encodedParams: ArrayList<Pair<String, String>> = arrayListOf() | ||
| val params: ArrayList<Pair<String, String>> = arrayListOf() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We create and add items to params, but I cannot see where it is read from.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, its a bug we should put it to encoded params, as we build serach url dynamically due to shortcomings of http lib we use
| } | ||
| }.toObservable() | ||
|
|
||
| fun search(text: String, encodedParams: Array<Pair<String, String>> = arrayOf()): Observable<ConstructorData<SearchResponse>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rename search to getSearchResults to match getAutocompleteResults?
No description provided.