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

Search by keyword #5

Closed
uyab opened this issue Aug 25, 2016 · 6 comments
Closed

Search by keyword #5

uyab opened this issue Aug 25, 2016 · 6 comments

Comments

@uyab
Copy link
Contributor

uyab commented Aug 25, 2016

Use case
Autocomplete via ajax. Usually when we built some form input that ask user to select specific village, we force user to select province, and then city, and then district, and then village. I want to get rid all of those step, and just let user to type their village directly into textbox, and then system will provide suggestions via autocomplete.

@uyab
Copy link
Contributor Author

uyab commented Aug 26, 2016

I think we can implement it as chainable method for each content type or for overall, e.g:

// specific content type
Indonesia::search('sra')->getProvince();
Indonesia::search('karang')->paginateProvince();
Indonesia::search('solo')->getCities();

// all content type
Indonesia::search('kotaba')->get();

@adhatama
Copy link
Contributor

Do you mean the search from Laravel Scout in Laravel 5.3?

@uyab
Copy link
Contributor Author

uyab commented Aug 26, 2016

How it work under the hood was up to you, just make the API consistent with
Laravel.

On 26 Aug 2016 16:00, "Adhatama" notifications@github.com wrote:

Do you mean the search from Laravel Scout
https://www.laravel.com/docs/5.3/scout#searching in Laravel 5.3?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#5 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAJI1PAcw2BWZdfWq71zAyc6KhUmXAh-ks5qjqsggaJpZM4JsywW
.

@uyab
Copy link
Contributor Author

uyab commented Aug 26, 2016

Simple search using LIKE might be enough.

On 26 Aug 2016 16:25, "bayu hendra" uyab.exe@gmail.com wrote:

How it work under the hood was up to you, just make the API consistent
with Laravel.

On 26 Aug 2016 16:00, "Adhatama" notifications@github.com wrote:

Do you mean the search from Laravel Scout
https://www.laravel.com/docs/5.3/scout#searching in Laravel 5.3?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#5 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAJI1PAcw2BWZdfWq71zAyc6KhUmXAh-ks5qjqsggaJpZM4JsywW
.

adhatama added a commit that referenced this issue Aug 27, 2016
@adhatama
Copy link
Contributor

@uyab What do you think about this results for search all? Which is better?

[
    'provinces' => Collections,
    'cities' => Collections
    ...
]

or

[
    Province Object,
    Province Object,
    City Object,
    City Object,
    ...
]

adhatama added a commit that referenced this issue Aug 27, 2016
adhatama added a commit that referenced this issue Aug 27, 2016
@uyab
Copy link
Contributor Author

uyab commented Aug 27, 2016

The second is better

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