canceo
canceo

Reputation: 49

Strategies to Implement search on XML file

I have found some posts related to search on XML but those were not helpful for my task.

My task is to implement a search. Source: 5-6 XML files like People,Buildings,News etc (each category being an XML file I have 30000 Entries totally). User can select a category and type some keyword. The search phrase should search the XML file and return results are to presented on a html page. If user doesn't select a category all XML files should be searched.

Please tell me best strategy/Algorithm to implement this and best technology.

Upvotes: 1

Views: 1483

Answers (1)

Mark O'Connor
Mark O'Connor

Reputation: 77991

Transform your XML documents (using XSL) and upload them (HTTP post) to an instance of Solr. You'll then be able to perform a range of search operations on the indexed data.

The Solr Wiki is unavailable currently, but here's an example of it's support XML format:

<add>
  <doc>
    <field name="employeeId">05991</field>
    <field name="office">Bridgewater</field>
    <field name="skills">Perl</field>
    <field name="skills">Java</field>
  </doc>
  [<doc> ... </doc>[<doc> ... </doc>]]
</add>

Upvotes: 4

Related Questions