KETSE / casebox

Casebox: Secure all your information and team communication in one place
https://www.casebox.org
216 stars 120 forks source link

Wrong order on thesauri items inside Object-typed fields #14

Closed RafaPolit closed 8 years ago

RafaPolit commented 8 years ago

Problem

When I create an Objects type field pointing to a thesauri folder with several items inside, they get ordered only alphabetically.

Is there a way to configure the field so that the items are sorted by the 'order' data field, which is correctly configured?

Way to reproduce

This issue also happens if I use the

\CB\Browser -> getObjectsForField

method, in which there is no way of ordering the fields or to actually know the data order. We could sort them out ourselves if that data property would be returned by the method.

Thanks in advance, Rafa.

tvitalie commented 8 years ago

In order to get the thesauri sorted by order field you need to index that field in solr.

To do that, you have to find "order" field under "Templates/Thesauri Item" template, edit that field and set:

  1. solr_column_name = "order"
  2. set Config field equal to { "indexed": true } Config field should be a valid json string.

After updating the field you'll have to fully reindex the core to get solr records updated: ../bin/solr_reindex_core.php -c -a -l

Best regards

RafaPolit commented 8 years ago

Thanks for the quick response.

Quick summary of new issues

I still have further issues.

I have made the changes as suggested, here's what I did: Changes made

Here's the missing Order label, it shows an empty field where I can input the order: Missing label

Is there any further configs I need to change?

Thanks, Rafa.

tvitalie commented 8 years ago

Ok, I see the problem, check first screenshot. There are no titles set for English and Spanish languages. Find the same order field, edit and add values for Title (en), Title (es). Save and reload browser page.

Ill check if in barebone core these titles are set.

RafaPolit commented 8 years ago

Thanks, that solved the label issue.

Any idea how to approach the other issue? I need to re-save every item in order for it to get 'listed' as an ordered field? Is there another way to reindex the core?

Thanks again.

tvitalie commented 8 years ago

did reindex script give any result ? here is how I execute it from shell (under windows): d:\devel\www\casebox\bin>php solr_reindex_core.php -c test -a -l

2015-07-17 17:30:46 Processing core test ... updating tree optimizing

Note: "test" is name of the core (without prefix).

RafaPolit commented 8 years ago

Yep, gives that exact result: updating tree and optimizing (I replaced the test core name with my own as expected), but the items don't get an order inside solr until I re-save them inside casebox.

As soon as a I change something and re-save the item, the order field appears as expected under SOLR.

tvitalie commented 8 years ago

Sorry, I've forgot about solr prepared data. You have to update it before reindex core: d:\devel\www\casebox\bin>php update_solr_prepared_data.php -c test -a Total objects: 54

Done

and then reindex solr

RafaPolit commented 8 years ago

Great! Thanks, that did it. No need to re-save every item now.

Thanks for the feedback, time, and staying behind us during development.

Best regards, Rafa.