Best way to find data in xml files?

In our new project, we must provide a search function to extract data from hundreds of xml files. I have a summary of our current plan below, I would like to know your suggestions / improvements on this.

These xml files contain personal information, and the search is based on 10 elements, for example, name, name, email, etc. Our current plan is to create the main XmlDocument with all the searchable data and the key to the actual file. Thus, when a user searches for data, we first look at the main file and get the results. We will also cache actual xml files from recent searches, so subsequent simillar requests can be quickly processed.

Our application is a .net 2.0 web application.

+1
source share
5 answers

First: how large are the xml files? XmlDocumentdoes not scale to "huge" ... but can handle "large" OK.

Secondly: can you put the data in a regular database structure (possibly SQL Server Express Edition), index it and access it through regular TSQL? Usually this will do an xpath search. Similarly, if it is structured, SQL Server 2005 and above support a data type xmlthat destroys data - this allows you to index and query xml data in a database without having the entire DOM in memory (it translates xpath into relational queries).

+5
source

SQL Server, SQL- XPath.

+1

, , Xml, . , XPath, XmlReader.

Xml , , .

+1

XML . http://incubator.apache.org/lucene.net/

SQL .

xml ( , ).

.

Much easier than trying to sort through a bunch of files.

+1
source

Why don't you store search data in a database table with a key to the actual file? Thus, your search will be displayed in the database table, and not in the xml file. I assume this will be faster because you can index the table for faster searches.

0
source

Source: https://habr.com/ru/post/1795850/


All Articles