Skip to content

Conversation

@qbasso
Copy link
Contributor

@qbasso qbasso commented Mar 7, 2019

No description provided.

@qbasso qbasso requested a review from rubikzube March 7, 2019 20:25
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>> {
Copy link
Contributor

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?

Copy link
Contributor Author

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>> {
Copy link
Contributor

@rubikzube rubikzube Apr 2, 2019

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?

Copy link
Contributor Author

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()
Copy link
Contributor

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.

Copy link
Contributor Author

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>> {
Copy link
Contributor

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?

@rubikzube rubikzube merged commit 1c8b61d into develop Apr 16, 2019
@rubikzube rubikzube deleted the ch2527/search branch April 16, 2019 19:48
rubikzube added a commit that referenced this pull request Apr 16, 2019
* added lint to build (#29)
* added http tests (#30)
* updated libraries/gradle & added code coverage reports (#33)
* added revenue param to purchase tracking call (#34)
* added search functionality (#35)
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

Successfully merging this pull request may close these issues.

3 participants