Opened 12 years ago

Last modified 12 years ago

#1171 new defect

Category Search fails after editing the Category name

Reported by: vsinceac Owned by: geonetwork-devel@…
Priority: major Milestone: v2.10.0 RC0
Component: Catalog server Version: v2.6.5
Keywords: Category Cc:

Description

Hi,

Cannot retrieve metadata by category after changing the category name (while localized name remains unchanged).

Found this defect on GeoNetwork 2.6.5. Checked also on 2.9.0-SNAPSHOT (same result).

When the GN administrator changes the name of a category (Administration-CategoryManagement-Edit), the user interface will always show the localized name of that category. If there was results before this change, there will be no more results after the change.

Is the search in the database done by using the field "name" from the table categoriesdes, instead the feld "id"?

Steps to reproduce the bug: 1)Add a new category "MOMO" (the English name will be automatically "MOMO", too); 3)Search for any metadata and set it to the category "MOMO" (button OtherActions-Category); 4)Click on category "MOMO" in Simple Search --> OK (one result) 5)Change category name "MOMO" to "TOTO" (Administration-CategoryManagement-Edit-Save); 6)Click on category "MOMO" in Simple Search --> NOK (zarro result);

Allow a metadata to any category;

  • Change the name of the category

Change History (3)

comment:1 by vsinceac, 12 years ago

Sorry for the format...

Steps to reproduce the bug:

1) Add a new category "MOMO" (the English name will be automatically "MOMO", too);
3) Search for any metadata and set it to the category "MOMO" (button OtherActions?-Category);
4) Click on category "MOMO" in Simple Search --> OK (one result)
5) Change category name "MOMO" to "TOTO" (Administration-CategoryManagement?-Edit-Save);
6) Click on category "MOMO" in Simple Search --> NOK (zarro result);

Allow a metadata to any category; - Change the name of the categor

comment:2 by vsinceac, 12 years ago

The workaround would be to rebuild Lucene index after each category name change..
It appears the search for category is done in Lucene index, which stores the real category name for each metadata.
I didn't know categories are indexed by Lucene. Isn't faster to use extract metadata by category ID directly from the database, for the Simple Search?

comment:3 by fxp, 12 years ago

Maybe we should improve that by:

1) displaying a warning message to the user editing the category, that the index needs to be updated

2) trigger an index update (automatically?)

The same will happen when renaming a group.

Note: See TracTickets for help on using tickets.