You generally would store the necessary information as part of your view,
or more likely as part of the form, inside the database for later
retrieval.

In your scenario though, your AJAX requests should be using GET or HEAD
requests, and even the search form itself should be using a GET action,
allowing links to saved searches, but more importantly, capturing the
submitted search terms directly in to your logs (although this may require
some minor tweaking on your web server to log the extra GET parameters upon
the actual form submission).

TL;DR;

Unless you plan on storing the results of the search queries, everything
you need would be in your web server access logs with no changes to Django
itself.

-James
On Nov 8, 2014 5:08 AM, "Radek Svarz" <radek.sv...@gmail.com> wrote:

> Thanks James. In the case of using GET there seams to be plenty of log
> analyzers, so we have a lot of options.
>
> Any best practice / experience when using POST?
>
> I understand we can store the query to the DB, even using django model for
> that. But I am afraid of the performance hit.
>
> Radek
>
> On Saturday, November 8, 2014 10:42:03 AM UTC+1, James Schneider wrote:
>>
>> Wouldn't all of your AJAX requests be logged in your web server access
>> logs, assuming that you are using GET requests for your searches?  You can
>> parse those for analysis.
>>
>> You could also probably configure Whoosh or whatever calls the search
>> function to write a record in the database with the query, and probably the
>> results, although probably not advisable on heavily trafficked sites or if
>> large result sets are common.
>>
>> -James
>> On Nov 7, 2014 9:05 AM, "Radek Svarz" <radek...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> what is the best practice to setup the logging of search autocomplete
>>> logging for future analysis?
>>>
>>> When using Whoosh as a search engine and django.
>>>
>>> The search is searching within hundred thousands of product names.
>>>
>>> We want to get the insight on typos and typical name abbreviations.
>>>
>>> The autocomplete searches are performed using AJAX requests to /search/
>>> URL.
>>>
>>> Thanks.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit https://groups.google.com/d/
>>> msgid/django-users/b9943bb0-fc6c-4bff-86cc-45f1dd28c1df%
>>> 40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/b9943bb0-fc6c-4bff-86cc-45f1dd28c1df%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/ec51a70c-c16a-471b-9b18-4915b5227f23%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/ec51a70c-c16a-471b-9b18-4915b5227f23%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2Be%2BciVaD%3DL44-5iH8wjETN5mUCPFZM8Fj0_vJV2cb%3DWHJexSQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to