[ckan-dev] Solr schema adjustements
Stefan Oderbolz
stefan.oderbolz at liip.ch
Mon Aug 31 13:44:13 UTC 2015
Hi Adrià,
you probably meant `before_index` or do I misunderstand the docs here?
> Extensions will receive what will be given to the solr for indexing. This
is essentially a flattened dict (except for multli-valued fields such as
tags) of all the terms sent to the indexer. The extension can modify this
by returning an altered version.
http://docs.ckan.org/en/latest/extensions/plugin-interfaces.html?highlight=interfaces#ckan.plugins.interfaces.IPackageController.before_index
- Stefan
On Wed, Aug 12, 2015 at 9:28 AM, Adrià Mercader <adria.mercader at okfn.org>
wrote:
> Hi Dan,
>
> Just to add to Joe's excellent suggestion, I'll quickly point that the
> best place to tweak the search internally is the `before_search` extension
> point, that allows you to modify what gets sent to Solr:
>
>
> http://docs.ckan.org/en/latest/extensions/plugin-interfaces.html?highlight=interfaces#ckan.plugins.interfaces.IPackageController.before_search
>
> Cheers,
>
> Adrià
>
>
>
> On 12 August 2015 at 08:00, Dan Mihaila <danmihaila at gmail.com> wrote:
>
>> Hi Joe,
>> This is an excellent idea and it will be good to have it in docs. We will
>> give a try and will let you know our results.
>>
>> Thanks for quick reply.
>>
>> Cheers,
>> Dan Mihaila
>>
>>
>> > On 12 Aug 2015, at 03:03, Joe Tsoi <joe.tsoi at okfn.org> wrote:
>> >
>> > Hi Dan,
>> >
>> > This is the sort of are that I've been meaning to add to the docs for
>> > a while. You shouldn't need to mess around with the schema to do what
>> > you require, as the schema already contains the tags the dataset has.
>> > Although I may be misreading what you require.
>> >
>> > I would use use boosting to improve the search relevency of the alpha
>> > datasets. For example I can search for datasets containing a "test"
>> > tag or a "economics" tag, but also boost the search relevency of any
>> > dataset with the tag economics by typing "(tags:Test) OR
>> > (tags:economics)^2.0" into the default search box. You can see and
>> > example of this on demo.ckan.org
>> >
>> > http://demo.ckan.org/dataset?q=(tags%3ATest)+OR+(tags%3Aeconomics)^2.0
>> >
>> > The economics results will appear above the test tag results as we've
>> > boosted their relevency. I recommend you take a look at some of the
>> > solr tutorials out there if you want to know more
>> >
>> > http://www.solrtutorial.com/solr-search-relevancy.html
>> >
>> > anything passed to q will be passed along to the q parameter in solr.
>> > You could probably mess around with the front end templates to help
>> > users construct this query instead of having users have to know solr
>> > syntax, but as I said this is an area I've been meaning to add to the
>> > docs for a while.
>> >
>> > hope that helps a bit.
>> >
>> > Joe
>> >
>> >> On 11 August 2015 at 15:28, Dan Mihaila <danmihaila at gmail.com> wrote:
>> >> Hello,
>> >> In our CKAN project (http://data.rwlabs.org) we would like to boost
>> tags in search results. For example if an user searches "alpha" we would
>> like to see in search results datasets that don't contain "alpha" in title
>> or description,etc. but they have a tag named "alpha".
>> >> My question is if it safe to play with SOLR schema (what could be the
>> impact on other searches) and if there are any recommendations about this?
>> >>
>> >> Regards,
>> >> Dan Mihaila
>> >>
>> >> _______________________________________________
>> >> ckan-dev mailing list
>> >> ckan-dev at lists.okfn.org
>> >> https://lists.okfn.org/mailman/listinfo/ckan-dev
>> >> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>> > _______________________________________________
>> > ckan-dev mailing list
>> > ckan-dev at lists.okfn.org
>> > https://lists.okfn.org/mailman/listinfo/ckan-dev
>> > Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>> _______________________________________________
>> ckan-dev mailing list
>> ckan-dev at lists.okfn.org
>> https://lists.okfn.org/mailman/listinfo/ckan-dev
>> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>>
>
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>
>
--
Liip AG // Limmatstrasse 183 // CH-8005 Zürich
Tel +41 43 500 39 80 // GnuPG 0x7B588C67 // www.liip.ch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20150831/358c045c/attachment-0003.html>
More information about the ckan-dev
mailing list