I want to make full text Search for the Complete XML Document using Wildcards
To do this I set the name of an input field as query(//., ~=)
And it works fine
Everything is ok till now.
Now the problem is :
My XML Schema is quite big and I want to know the path of the subnode which contains this query data.
Is there any way to get this path?
This would be wonderful if I can get this path.
X-Application Version: 3.1.2
Tamino Version : 3.1.1
Platform : Win2k,
WebContainer : Tomcat 3.3a
JDK Version : 1.3.1
yes, good idea. We also would like to have such functionality within our X-Application framework. We could manage sub-documents. Especially, for recursive schemas it would be necessary to have the path expression to identify the node when using ‘//’ within the query expression. Perhaps, we will make proposal to extend Tamino with a ‘path’ function.
Are more people interested in this functionality, let me know.
When I read your post, I was absolutely surprised that this kind of query you described can be handled by X-Application.
Did you define also a parameter with name ‘queryschema(…)’?
Lets assume you defined a queryschema(Property), I would expect that X-Application sends an XQL expression to Tamino of the form
In this case you receive the Property documents. The returned documents have at least one element whose content contains the string ‘…’.
Could you check whether you received documents starting from the root element or ‘sub-documents’ starting from the element which contains the string ‘…’.
Your assumption is correct.
In fact I did not write a jsp file for search.
I have only changed the one generated by XApplication.
So that means I have added
to the generated page and the result documents are displayed in the list page.
I am sending the page as an attachment in case you would like to examine.
To answer your last question;
I dont have any data node under root element but only sequences so I can not check what you have wanted
My root element has an attribute as @ProtokolNo
the full text search doesnt find the data in this attribute.
Thanks for your interest,
I would be glad if ths path function will be implemented.
sKimlik.jsp (6.51 KB)
what is logic that free text search will work only for elements not for attributes ? just curious !
Is there some query that can be used to do a free text search on attribute values as well.
Well my schema is not large at all, but there are plenty of attributes, if i use multiple queries of the form
(i)query(//.,~=) (for element-value search)
(ii)query(/entry/metaterms/era/@type,=) (for attribute search)
and so on it gives an intersection of all these (rightly so), but if some way i could have free text search of the form (i) to work with attributes too it will solve the problems.
as I understood your question you are looking for a XQL expression which returns only the attributes.
You can use
//@[.~=‘your search expression’]
//[@*~=‘your search expression’]
It returns a list of elements which contain at least one attribute matching your search expression.
You can try it out which the Tamino Interactive Interface.
However, I don’t think that you can use this kind of query within the current version of X-Application. It requires a doctype (root element) to get the reference to the collection.
If you want to implement the full text search based on attributes, you should program against the Tamino API for Java. Have a look at the class TaminoStore. This code (e.g. from the method query) could help.
Hi Christian Freytag,
Thanks for your reply,
The current implementation of xapp supports query(//@,~=) , how ever i want to have a search which will do both attribute and element value search in one search command. i.e query(//,~=) or query(//@*,~=).
I could use directcommand and do two separate queries but then i can only sort the results in each query but not inclusive of each other.
The current xapp does search with in a search i.e it narrows the results, how ever i have not been able to discover how to get a union of searches, as i mentioned above a single search which will look at the attributes and the element node values at the same time.
let me know if you an example from my end will make things more clear. Any ideas as how to pursue this.
could you post your schema and query page (or page with directcommand) to the community. I will have a look at it and check which query is internally processed. Perhaps, with this information we can find a way to combine the two queries.
The query page which uses directcommand will be some thing like this
a) <bdm:directcommand type=“query” schema=“entry” queryparm="//@ ~= " sortby=“title” />
b) <bdm:directcommand type=“query” schema=“entry” queryparm="//entry ~= " sortby=“title” />
a) does the attribute search
b) does the node value search (element search)
If using form
<input type=“text” name="query(//entry,~=)>
<input type=“text” name="query(//@*,~=)>
The schema is attached.
irish.tsd (5.49 KB)
I checked the code to find out which query is generated in case of directcommand and query input fields.
For the directcommand the XQL is generated in the following form
This means that your directcommand return ?entry? documents which will have at least one element or one attribute (for the second case) containing the search string. You could combine the two directcommands using or / and operators. For a union you should use the or operator
<directcommand type=?query? schema=?entry? queryparm=?//~=?? or //@~=???/>
//~=?<search string 1>? or //@~=?<search string 2>?
I don?t know if you expected this result since the element or attribute matching the search string may be anywhere within the returned documents.
For the input tags the query is generated in the same way. You have to specify a parameter queryschema(entry). The documents which are returned are entry documents.
Remark: Query input fields are combined by an AND operator. If you use the two query input fields you described on the same page, you will get the XQL expression
/entry[//~=?search key 1? and //@~=?search key 2?]
To create a union with query input field is not possible. But, for the next version of X-Application we will improve the query handling. Than, it is possible to define a union also for query input fields.
[This message was edited by Christian Freytag on 16 May 2002 at 08:17.]
Thanks for your reply,
This does it.