Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of embodiments of the present application, instead of all the embodiments.It is based on
Embodiment in the application, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall in the protection scope of this application.
Referring to Fig. 1, it illustrates the streams provided by the present application applied in the document data search method embodiment 1 of server
Journey.As shown in Figure 1, the present embodiment may include step S101~step S104.
Step S101: if receiving the retrieval request of client transmission, the search key in retrieval request is extracted.
Wherein, document data is stored in advance in server.Document data may include that the title, catalogue and catalogue of document are corresponding
Particular content etc..Document data can be various types of document, such as textbook, standard document.
Wherein, standard document is usually in order to instruct or certain industry behavior of specification and the document formulated, for example, " marine
Wind power plant steel structure anti-corrosion technical specification " in define anticorrosive measure, anticorrosion requirement, inspection and acceptance criteria etc..
For another example, power engineering construction item is defined in " power engineering construction project safety in production standard convention and rating scale up to standard "
Purpose Safety Production Target, organization and responsibility, safety in production investment, laws and regulations and safety management system, emergency management and rescue,
Accident report investigation and processing etc..
If user wants to check document data, retrieval request, retrieval request can be sent by user end to server
In include search key.
Step S102: the content type of search key is determined;Wherein, the target in content type and preset keyword table
Field is corresponding.
Before implementation, the tables of data comprising keyword is preset, it for ease of description, can be referred to as pre- by the tables of data
If key table.It may include several fields in preset keyword table, those fields are arranged according to document data, different
Field indicates different content types.
Aiming field in preset keyword table can be the description information of document, as document title, the applicable time section,
The scope of application, main contents etc..
Specifically, it is illustrated so that document is standard document as an example.For example, may include standard name in preset keyword table
Claim, for indicating the title of standard document.For another example, it may include timeliness field in preset keyword table, for indicating standard
The applicable time section of document.It for another example, can also include type field in preset keyword table, for indicating standard document
Type.The field value of type field can be " national standard ", " power industry standard ", " international standard ", " regulation text
Part ", " measurement criteria " etc..Certainly, it may include in the preset keyword table of standard document but be not limited to above-mentioned several words
Section, can also comprising standard No., the scope of application, inapplicable scope, main contents, emphasis and main points, be associated with standard and difference mark
It is any one or more in the fields such as standard.
Server just determines the interior of search key after extracting search key in the retrieval request that client is sent
Hold type.The content type of keyword be it is corresponding with the field in preset keyword table, i.e., can be with according to the content type
In preset keyword table, the field corresponding to it is determined.For ease of description, field corresponding to search key is known as
Aiming field.
It should be noted that the content type of search key is determined by client.Specifically, client can mention
For the input frame of search key, input frame is corresponding with content type, and user inputs search key in the input frame, then table
The content type for showing the search key is the corresponding content type of the input frame.For example, in the search interface that client provides
Comprising title input frame, if user inputs " quality " in the input frame, then it represents that the content of search key " quality "
Type is title, and the aiming field in the corresponding preset keyword table of this content type of title is title.
In above example, search key is one, and certainly, search key can be multiple, and each search key can be respective
A kind of corresponding content type.Detailed description is seen below.
It, can be by the content type of search key, such as input frame when user end to server sends search key
Corresponding content type is included in retrieval request, is sent to server jointly with search key.Therefore, server determines inspection
The specific implementation of the content type of rope keyword may is that in retrieval request, extract the corresponding content of search key
Type.
Step S103: in the field value of the aiming field of preset keyword table, the target comprising search key is searched
Field value.
By it is described above it is found that the content type of search key is with the field in preset keyword table be it is corresponding, really
After the content type for determining search key, aiming field can be found in preset keyword table according to the content type.
In turn, in the field value of aiming field, the field value comprising search key is searched, and the field value found is known as mesh
Field value.
For example, aiming field is title, then in each title, search comprising search key " quality "
Title, the title found include " project of transmitting and converting electricity instructs supervision and check outline ", " power engineering quality surveillance body
It is Adjusted Option " etc..
Step S104: the corresponding document data of target word segment value is returned into client.
Wherein, the corresponding document data of target word segment value may include target word segment value itself, or may include target
Other document datas corresponding to field value.Specific corresponding document data is arranged according to the actual situation, i.e., user clicks search
Afterwards, which document data server will return to and select for user, then is arranged which document data target word segment value corresponds to.
For example, server is intended for the title that user returns to document, then can be by target word segment value after user clicks search
Corresponding document data is set as the title of document.For another example, after user clicks search, server is intended for what user returned to document
Catalogue can then set the corresponding document data of target word segment value to the catalogue of document.
Server can return to what type of text according to the type of the search key extracted to determine to client
File data.Specifically, for example, the search key that server extracts is the search key in file catalogue, then by target
The corresponding directory name of field value returns to client.
For example, it is the search interface comprising catalogue that client, which is the search interface that user provides, user is defeated in the interface
The search key entered is the search key in file catalogue, and the input operation of user indicates that user wants in these catalogues
The catalogue comprising search key is searched, therefore, the document data that server returns is the directory name comprising search key.
For another example, the search key that server extracts is the search key in document title, then by target word segment value
Corresponding document title returns to client.
For example, client is the search interface that the search interface that user provides includes document title, user is in the interface
The search key " quality " of input and " power transmission and transformation " are the search key in document title, and the input operation of user indicates to use
Family wants to look up the document title comprising " quality " and " power transmission and transformation ", and therefore, the document data that server returns is comprising retrieval
The document title of keyword.
From the above technical scheme, this application provides a kind of document data search method implementations applied in server
Example after the present embodiment receives the retrieval request of client transmission, extracts search key, and determine retrieval from retrieval request
The content type of keyword, and then in the field value of the field for indicating the content type of preset keyword table, lookup includes
The field value of search key, and document data corresponding to the field value found is returned into client.As it can be seen that the present embodiment
The search key that can be sent according to client is searched in the field value of preset keyword table comprising search key
Field value, and then document data corresponding to field value is returned for client.
By taking document is standard document as an example, a concrete application scene of above-mentioned document data search method embodiment is,
User inputs some search key in client, and the title of the standard document comprising the search key is returned to visitor by server
Family end.
After client displays for a user the title of standard document, further, user may also want in these standards text
Shelves in some standard document in, retrieval include search key specific documentation page, certainly, the search key with it is above-mentioned defeated
The search key entered may be the same or different.
Therefore, this application provides document data search method embodiments 2, as shown in Fig. 2, document data search method is real
Example 2 is applied on the basis of above-mentioned document data search method embodiment 1, can also include step S201~step S204.
Step S201: if receiving the file acquisition request of client transmission, target text is extracted from file acquisition request
Shelves title and file retrieval keyword;Wherein, the entitled user of destination document selects in the document title that client receives
Document title, file retrieval keyword is the keyword that inputs in client of user.
Wherein, in above-mentioned document data search method embodiment 1, the document data that server is returned to client includes text
Shelves title, after client shows document title, user can select some document title as mesh in multiple document title
Document title is marked, and inputs keyword, which is known as file retrieval keyword.It should be noted that this article document search
Keyword can be same or different with the search key in above-mentioned document data search method embodiment 1.
Destination document title and file retrieval keyword are encapsulated in file acquisition request by client, are sent to service
Device.After server receives file acquisition request, destination document title therein and file retrieval keyword are extracted.
Step S202: destination document corresponding to destination document title is determined;Wherein, destination document includes picture type
Document, literal type document in any one or two kinds.
Wherein, server searches document corresponding to the destination document title in pre-stored several documents, in order to
Convenient for description, the document found can be known as destination document.
It should be noted that the pre-stored document of server can be the document of picture type, it is also possible to text class
The document of type, alternatively, both having.The document of picture type refers to the picture comprising document text, that is to say, that is figure
The document of piece format.For the document of this type, directly document text cannot be replicated using selection and copy function,
It is possible to prevente effectively from the wide-scale distribution of document text.The document of literal type is referred to using copy editor such as word, wps etc.
The document that tool is write.For this type document, text directly can be therefrom got.
For server according to destination document title, the destination document found may include the document of picture type, can also be with
Document comprising literal type.
Step S203: it if destination document includes the document of picture type, in the document of picture type, searches comprising text
The photo-document page of document search keyword, and photo-document page is returned into client.
Wherein, if server search destination document include picture type document, need for client return include
The photo-document of file retrieval keyword.Specifically, server needs in the document of picture type, and searching includes file retrieval
The documentation page of the picture type of keyword, and the documentation page found is known as photo-document page, which is returned into visitor
Family end.
Specifically, above-mentioned lookup includes that the mode of the documentation page of the picture type of file retrieval keyword may include, and is taken
Business device obtains the document of literal type corresponding to the document of picture type first, in the document of the literal type, searches packet
The documentation page of the keyword containing file retrieval after finding documentation page, then obtains the picture text of picture type corresponding to documentation page
The document page is alternatively changed into the photo-document page of picture type by shelves page.
Step S204: it if destination document includes the document of literal type, in the document of literal type, searches comprising text
The word or file page of document search keyword marks file retrieval keyword in word or file page, and word or file page is returned
Client.
Wherein, if the destination document that server is found includes the document of literal type, directly in the literal type
In document, the word or file page comprising file retrieval keyword is searched, if finding, in word or file page, with highlighted etc.
Mode marking document search key, and the word or file page after label is returned into client.
From the above technical scheme, the present embodiment not only can return to the document name comprising search key for user
Claim, can also further be retrieved for user comprising text after user selects some document title and input file retrieval keyword
The documentation page of document search keyword, and documentation page is returned into user.It should be noted that documentation page can be the figure of picture type
Piece documentation page is also possible to the word or file page of literal type, and file retrieval key can also be marked in word or file page
Word facilitates user to check.
In practical applications, if user is in the search interface comprising catalogue that client provides, the retrieval of input is crucial
Word, then server, can also be by the picture category corresponding to directory name other than returning to the directory name comprising search key
The document data of type returns to client.
Specifically, before implementation, picture is converted by document corresponding to directory name.Server is searched in step S103
To after target word segment value, by the number of files of picture type corresponding to directory name corresponding to target word segment value and directory name
According to return client.
For example, user is " quality " by the search key that client is sent, the search key is for searching for document
Catalogue in include " quality " catalogue, after server finds the directory name comprising " quality ", by the directory name and should
The document data of the corresponding picture type of directory name returns to client.
Specifically, as shown in figure 3, the set-up mode of preset keyword table can pass through following steps S301~step S303
It realizes.
Step S301: document to be analyzed is obtained;Wherein, document to be analyzed is write according to default document format, presets
The content type of document format expression document data is corresponding with the position that document data occurs.
It should be noted that in this application, document to be analyzed is the document write according to default document format.Default text
Shelves format indicates that the predetermined position in document occurs that the document data of preset content type.For example, in document homepage
The title of one behavior document, the timeliness of the second behavior document, the scope of application of third behavior document, the second page of document are document
Catalogue etc..
Certainly, it will be appreciated by those skilled in the art that and it is expected that the other content type of document data and document data go out
Existing other positions, and within the scope of protection of this application.
Step S302: in the predetermined position of document to be analyzed, document data is obtained.
Wherein, in analysis, the predeterminated position of document to be analyzed is successively retrieved, the number of files of the predetermined position is obtained
According to.For example, predeterminated position is homepage the first row, the second row of homepage, homepage the third line and second page etc., successively get each
The document data of predetermined position.
Step S303: extracting keyword in document data, and keyword is saved as to the word of the aiming field of key table
In segment value;Wherein, aiming field is the corresponding field of content type of document data.
Wherein, after predetermined position gets document data, search key is extracted from document data.Specifically,
The mode for extracting search key, which can be, segments document data, and the word that participle is obtained is as search key.
The keyword extracted is saved in the field of key table, the field value as field.Which specifically is saved in
One field is determined by the content type of the document data extracted.Wherein, the content type of the document data extracted can
With occur according to document data position, format or comprising the type of keyword determine.
For example, the document data extracted appears in document homepage the first row, format is overstriking, No. two fonts, then can be with
Determine that this article file data is Document Title.
For another example, the document data extracted is " implementing from April 15th, 2014 ", and keyword wherein included has " certainly "
" year " " moon " " day " and " implementation " can then determine that this article file data is the timeliness of document.Certainly, those skilled in the art can be with
The other modes for understanding and it is expected the keyword that document data includes, without departing from the protection scope of the application.
After the content type for determining document data, the keyword of this article file data is just saved in the content type of document
In field.For example, the document data extracted is " implementing from April 15th, 2014 ", the pass extracted from this article file data
Key word is " on April 15th, 2014 ", then the keyword is saved in timeliness field.
In an implementation, if the search key that user inputs in client is multiple, and multiple inspection is set in client
Logic connecting relation between rope keyword, then the search key that server is extracted from retrieval request be it is multiple, can
With the logic connecting relation between foundation search key, to search the document data for needing to return client.
Specifically, above-mentioned to apply in the document data search method embodiment 1 of server, step S103 (is closed default
In the field value of the aiming field of key word table, search include search key target word segment value) specific implementation include
Following steps A1.
Step A1: it is directed to each search key, in the field value of the corresponding field of preset keyword table, lookup includes
The target word segment value of the search key.
Wherein, search key has multiple.For each search key, following steps can be executed: search the inspection
Rope keyword field corresponding in preset keyword table, and in the field value of the field found, it searches comprising retrieval
The field value found is known as target word segment value by the field value of keyword.
Search key be it is multiple, then the target word segment value found be it is multiple.
It should be noted that the content type of search key can be identical, can also be different.For example, retrieval is closed
Key word is respectively " quality " and " power transmission and transformation ", and this two crucial content types of retrieval are title.For another example, retrieval is closed
Key word is respectively " quality " and " on January 1st, 2015 ", and the content type of two search keys is respectively timeliness and standard name
Claim.
Correspondingly, above-mentioned to apply in the document data search method embodiment 1 of server, step S104 is (by target word
The corresponding document data of segment value returns to client) specific implementation include the following steps A2~step A3.
Step A2: if logic connecting relation be also, if by the corresponding text of the target word segment value of whole search keys
File data returns to client.
Wherein, the logic connecting relation between multiple search keys can be what user was arranged in client.For example,
After user inputs multiple search keys, and the logic connecting relation between search key is set.The logical connection of setting is closed
System can be " and ", be also possible to "or".
If the logic connecting relation of user setting be and, then it represents that user want use multiple conditions, to search document
Data.Therefore, the document data that the target word segment value of each search key is directed to by server returns to client.
For example, search key is respectively " quality " and " on January 1st, 2015 ", wherein the content type of " quality " is mark
Quasi- title searches the target word segment value comprising quality, it is assumed that the target word segment value pair of lookup then in the field value of title
The document data answered is respectively document data 1 and document data 2.In addition, the content type in " on January 1st, 2015 " is timeliness, then
In the field value of timeliness, the target word segment value comprising on January 1st, 2015 at this time point is searched, and assume the mesh found
The corresponding document data of field value is respectively document data 1 and document data 3.The number of files that two search keys are directed to
According to for document data 1, then document data 1 is returned into client.
Step A3: if logic connecting relation be alternatively, if the target word segment value of each search key is corresponding
Document data returns to client.
Wherein, if the logic connecting relation of user setting be or, then it represents that user wants to look up meets item in a certain respect
The document data of part.That is, server need by the target word segment value of each search key respectively corresponding to document
Data return to client jointly.
Illustrate for the still above example.Wherein, " quality " corresponding document data be document data 1 and document data 2,
" on January 1st, 2015 " corresponding document data be document data 1 and document data 3, then by document data 1, document data 2 and
Document data 3 returns to client.
Provided by the present application apply is introduced in the document data retrieval device of server below, needs to illustrate
It is, hereafter in relation to applying the explanation of the document data retrieval device in server to may refer to provided above apply in server
Document data search method, do not repeat below.
Apply the document data search method embodiment 1 in server corresponding with above-mentioned, this application provides one kind to answer
Document data used in server retrieves Installation practice 1.As shown in figure 4, the present embodiment can specifically include: search key
Extraction module 401, key word type determining module 402, target word segment value searching module 403 and document data return module 404.
Wherein:
Search key extraction module 401 extracts in retrieval request if the retrieval request for receiving client transmission
Search key;
Key word type determining module 402, for determining the content type of search key;Wherein, content type and pre-
If the aiming field in key table is corresponding;
Target word segment value searching module 403, in the field value of the aiming field of preset keyword table, lookup includes
The target word segment value of search key;
Document data return module 404, for the corresponding document data of target word segment value to be returned to client.
From the above technical scheme, this application provides a kind of apply to implement in the document data retrieval device of server
After search key extraction module 401 receives the retrieval request of client transmission, it is crucial to extract retrieval from retrieval request for example
Word, key word type determining module 402 determines the content type of search key, and then target word segment value searching module 403 exists
In the field value of the field of the expression of the preset keyword table content type, the field value comprising search key, document are searched
Document data corresponding to the field value found is returned to client by data return module 404.As it can be seen that the present embodiment can root
According to the search key that client is sent, in the field value of preset keyword table, the field value comprising search key is searched,
And then document data corresponding to field value is returned for client.
Optionally, the structure applied in the document data retrieval Installation practice 2 of server shown in Figure 5.Such as Fig. 5
It is shown, the device further include: key table setup module 405, for preset keyword table to be arranged.
Wherein, key table setup module 405 may include:
Document obtains submodule 4051, for obtaining document to be analyzed;Wherein, document to be analyzed is according to default document lattice
What formula was write, the content type of default document format expression document data is corresponding with the position that document data occurs;
Document data acquisition submodule 4052 obtains document data for the predetermined position in document to be analyzed;
Document keyword saves submodule 4053 and keyword is saved as pass for extracting keyword in document data
In the field value of the aiming field of key word table;Wherein, aiming field is the corresponding field of content type of document data.
Optionally, the corresponding document data of target word segment value that target word segment value searching module 403 is found is document name
Claim, then, above-mentioned apply in the document data retrieval Installation practice of server can also include: that file acquisition request receives mould
Block, document determining module, photo-document return module and word or file return module.Wherein:
File acquisition request receiving module, if the file acquisition request for receiving client transmission, from file acquisition
Destination document title and file retrieval keyword are extracted in request;Wherein, the entitled user of destination document receives in client
Document title in the document title that selects, file retrieval keyword is the keyword that user inputs in client;
Document determining module, for determining destination document corresponding to destination document title;Wherein, destination document includes figure
Any one in the document of sheet type, the document of literal type or two kinds;
Photo-document return module, if including the document of picture type for destination document, in the document of picture type
In, the photo-document of the picture type comprising file retrieval keyword is searched, and photo-document is returned into client;
Word or file return module, if the document for destination document comprising literal type, in the document of literal type
In, the word or file of the literal type comprising file retrieval keyword is searched, and mark file retrieval crucial in word or file
Word, and word or file is returned into client.
Optionally, in the retrieval request that search key extraction module receives, search key is bound respective corresponding
Content type;
Correspondingly, key word type determining module includes:
Key word type determines submodule, in retrieval request, extracting the corresponding content type of search key.
Optionally, the search key that search key extraction module is extracted from retrieval request is multiple, and this is more
A search key has logic connecting relation;
Correspondingly, target word segment value searching module includes:
Target word segment value searches submodule, for being directed to each search key, in the corresponding field of preset keyword table
Field value in, search include the search key target word segment value;
Document data return module includes:
First document data returns to submodule, for if logic connecting relation be also, if by whole search keys
The corresponding document data of target word segment value returns to client;
Second document data returns to submodule, for if logic connecting relation be alternatively, if by each search key
The corresponding document data of target word segment value returns to client.
Optionally, the search key that search key extraction module extracts be file catalogue in search key or
Search key in document title;
Correspondingly, document data return module includes:
Directory name returns to submodule, if the search key for extracting is the search key in file catalogue,
The corresponding directory name of target word segment value is returned into client;
Document title returns to submodule, if the search key for extracting is the search key in document title,
The corresponding document title of target word segment value is returned into client.
Optionally, it applies and retrieves device in the document data of server further include:
Image data returns to submodule, if the search key for extracting is the search key in file catalogue,
The document data of the corresponding picture type of directory name is returned into client.
It should be noted that all the embodiments in this specification are described in a progressive manner, each embodiment weight
Point explanation is the difference from other embodiments, and the same or similar parts between the embodiments can be referred to each other.
It should also be noted that, herein, relational terms such as first and second and the like are used merely to one
Entity or operation are distinguished with another entity or operation, without necessarily requiring or implying between these entities or operation
There are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant are intended to contain
Lid non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in process, method, article or equipment including above-mentioned element.
The foregoing description of the disclosed embodiments makes professional and technical personnel in the field can be realized or use the application.
Various modifications to these embodiments will be readily apparent to those skilled in the art, as defined herein
General Principle can be realized in other embodiments without departing from the spirit or scope of the application.Therefore, the application
It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one
The widest scope of cause.