search xml using lucene ,is that possible?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2009 04:21 AM
Hi all
I got some xml files placed on some where like "Company Home > MyProject> Projects > Proposed > Submitted Project".
The "Submitted Project" folder contains xml files that represent data and forms of that project
and i want to search these xml files but i need the result as pairs of(tag : value) ;
some thing like "whrere projectId=2 and pipeWidth=8" so is that possible?? and if yes how?
the structure of xml look like this:
i did that using org.xml.sax package ,but i have to do that using lucene to increase performance and reduce the execution time of the search
i search the http://wiki.alfresco.com/wiki/Search but didn't find what i want
any one have some example ,link or any guide
help is highly appreciated
thanx in advance
mmrs
I got some xml files placed on some where like "Company Home > MyProject> Projects > Proposed > Submitted Project".
The "Submitted Project" folder contains xml files that represent data and forms of that project
and i want to search these xml files but i need the result as pairs of(tag : value) ;
some thing like "whrere projectId=2 and pipeWidth=8" so is that possible?? and if yes how?
the structure of xml look like this:
<project id=""> <properity1 /> <properity2 /> … ..</project>
i did that using org.xml.sax package ,but i have to do that using lucene to increase performance and reduce the execution time of the search
i search the http://wiki.alfresco.com/wiki/Search but didn't find what i want
any one have some example ,link or any guide
help is highly appreciated
thanx in advance
mmrs
Labels:
- Labels:
-
Archive
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2009 06:35 PM
… till now i came up with this:
searchFor: it's value (number)
but the problem is that lucene looks for string here not int here;
if element "pipeWidth" has the value:08 in the xml file ,and the search parameter were:
searchIn="pipeWidth"
searchIn=8 , then resultSet will be null :cry:
how can i fix this
please some one highlight this post
regards
mmrs
String xmlTag="<"+searchIn+">"+searchFor; SearchParameters sp=new SearchParameters(); sp.addStore( new StoreRef(StoreRef.PROTOCOL_WORKSPACE,"SpacesStore")); sp.setLanguage(SearchService.LANGUAGE_LUCENE); sp.setQuery("PATH:\"" + "/app:company_home/cm:MyProject/cm:Projects/cm:Proposed/cm:SubmittedProject" + "//*\" AND TYPE:\"" + ContentModel.TYPE_CONTENT + "\" AND TEXT:\"" + xmlTag + "\"");ResultSet resultSet = getSearchService().query(sp);
where searchIn: the xml ElementsearchFor: it's value (number)
but the problem is that lucene looks for string here not int here;
if element "pipeWidth" has the value:08 in the xml file ,and the search parameter were:
searchIn="pipeWidth"
searchIn=8 , then resultSet will be null :cry:
how can i fix this
please some one highlight this post
regards
mmrs
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2009 10:10 PM
The XML Metadata Extractor can be used for this - it extracts element and/or attribute values from XML files and stores them in metadata properties (which can be indexed into the search engine).
There's a page on the wiki that documents how to configure XML Metadata Extraction.
Cheers,
Peter
There's a page on the wiki that documents how to configure XML Metadata Extraction.
Cheers,
Peter
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2009 06:29 AM
thank you for ur respose
i will look for that page and try the XML Metadata Extractor
i will look for that page and try the XML Metadata Extractor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2009 10:28 AM
I have the same problem!
Did you solve it?
Did you solve it?
