= Lucene-Only search mode = || '''Date''' || 2011-10-31 || || '''Contact(s)''' || François Prunayre || || '''Last edited''' || 2011-10-31T18:25:00 || || '''Status''' || Being discussed, in progress, initial implementation in progress || || '''Assigned to release''' || 2.7.x || || '''Resources''' || Available || || '''Ticket #''' || #652 || == Overview == Current search rely on the following steps: * Lucene Search * Retrieve Metadata from Database (according to search criteria and paging) * XSL presentation. The aim of this proposal is to add a new search mode relying only on Lucene. This mode requires to structure and/or add all information required for results presentation in the index. [[Image(geonetwork-pure-lucene-search.png)]] The Lucene only search is available through the "q" service which return XML response. The widgets interface could be configured to use this service instead of xml.search (ie. classic user interface will not change). === Proposal Type === * '''Type''': Lucene, Core Change * '''App''': !GeoNetwork * '''Module''': !LuceneSearcher, Widgets === Links === * '''Documents''': * http://trac.osgeo.org/geonetwork/ticket/485 === Voting History === * Vote not yet proposed. == Motivations == * Performance improvements: search could be 10 to 20 time faster and better support concurrent users. The following charts compare 3 services: * xml.search in default mode (ie with DB, with XSL) * xml.search in fast mode (ie. with DB, no XSL) * q service (#485) which dump all index fields (ie. no DB, no XSL) Testing made: * with geocat.ch content (ie. 4000 records) * 10 iterations === Number of concurrent users increasing === [[Image(geonetwork-pure-lucene-search-perf.png)]] === number of records returned per page === [[Image(geonetwork-pure-lucene-search-perf-with-larger-number-of-results.png)]] == Proposal == The main requirement is to store all information available in the "brief" format in the index in order to retrieve those information at search time. Brief format is the pivot format used by GeoNetwork to display search results via xml.search or main.search.embeded services. Brief format fields are the following: * id * uuid * title * abstract * keyword * parentId * datasetcreationdate * geoBox * westBL * eastBL * southBL * northBL * Constraints (not supported/used in widget GUI, complex XML or as CData ?) * !SecurityConstraints (not supported/used in widget GUI, complex XML or as CData ?) * !LegalConstraints (not supported/used in widget GUI, complex XML or as CData ?) * temporalExtent (not supported/used in widget GUI) * begin * end * image type="unknown|thumbnail|overview" * responsibleParty role="{$role}" appliesTo="resource" logo="" * link title="" href="" name="" protocol="" type="" * category * + geonet:info/* The q service (#485) requires to retrieve those information from the index directly instead of dumping all index fields. The configuration is stored in config-lucene.xsl. All field to dump in the response MUST be stored. The others could not be stored (Note: total index size should be similar after this proposal changes because many useless fields are currently stored). {{{ }}} Complex fields like image, link, geoBox which are composed of child element are stored as "|" separated value. Those fields are structured in index-fields.xsl. Example: {{{ }}} The client !DataStore takes care of splitting the value to extract the information. {{{ ... 3 2f788e36-ca8e-4eeb-adc6-4d0c7da6eaf1 1 |Online link to the 'Water Resources and Irrigation in Africa'- website|http://www.fao.org/ag/AGL/aglw/aquastat/watresafrica/index.stm|WWW:LINK-1.0-http--link|text/html basins.zip|Hydrological basins in Africa (Shapefile Format)|http://localhost:8080/geonetwork/srv/en/resources.get?id=10&fname=basins.zip&access=private|WWW:DOWNLOAD-1.0-http--download|application/zip hydrological_basins|Hydrological basins in Africa|http://geonetwork3.fao.org/ows/296|OGC:WMS-1.1.1-http-get-map|application/vnd.ogc.wms_xml pointOfContact|metadata|FAO - NRCW| Hydrological Basins in Africa (Sample record, please remove!) n -1 0 maps datasets interactiveResources Major hydrological basins and their sub-basins. This dataset ... assigned respectively to internal sub-basins and to sub-basins draining into the sea) watersheds river basins water resources hydrology AQUASTAT AWRD Africa inlandWaters thumbnail|../../srv/en/resources.get?uuid=da165110-88fd-11da-a88f-000d939bc5d8&fname=thumbnail_s.gif&access=public eng -17.3|-34.6|51.1|38.2 n vector eng 1625 da165110-88fd-11da-a88f-000d939bc5d8 iso19139 2007-07-19T14:45:07 2007-11-06T12:13:00 2f788e36-ca8e-4eeb-adc6-4d0c7da6eaf1 true true false }}} === Backwards Compatibility Issues === None. === New libraries added === None. == Further improvements == * Support multilingual metadata: classic mechanism to use GUI language and fallback to main language is not implemented for this service. It should be part of the multilingual metadata indexing proposal (http://trac.osgeo.org/geonetwork/wiki/MultilingualIndexMechanism) and require more work. * Use it for CSW search when complete ISO record is not needed (eg. dublin-core output) * Create a Jeeves service with JSON output instead of XML+XSL to speed up JS client side processing * Keep the Searcher in session to not re-run search on all requests (like main.search do with search and present steps) == Risks == == Participants == * François Prunayre * Others?