Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 73956 invoked from network); 30 May 2006 12:17:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 30 May 2006 12:17:39 -0000 Received: (qmail 78374 invoked by uid 500); 30 May 2006 12:17:37 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 78001 invoked by uid 500); 30 May 2006 12:17:36 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 77989 invoked by uid 99); 30 May 2006 12:17:36 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 May 2006 05:17:36 -0700 X-ASF-Spam-Status: No, hits=1.9 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of piccinatto@ibest.com.br designates 200.181.68.90 as permitted sender) Received: from [200.181.68.90] (HELO webemail02.ibest.com.br) (200.181.68.90) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 May 2006 05:17:34 -0700 Received: from ibest.com.br (webemail02.ibest.com.br [127.0.0.1]) by webemail02.ibest.com.br (Postfix) with ESMTP id DEB012BAEA for ; Tue, 30 May 2006 12:17:11 +0000 (GMT) Content-Disposition: inline Content-Transfer-Encoding: binary Content-Type: text/plain MIME-Version: 1.0 X-Mailer: MIME::Lite 2.117 (F2.6; A1.50; B2.12; Q2.03) X-Mailer: IbestMail X-Organization: Ibest S/A X-Identity: 931768_1148991429 From: "hsp" To: dev@jackrabbit.apache.org Cc: Marcel Reutegger Subject: Re: Searching.... Date: Tue, 30 May 2006 09:17:09 -0300 Message-Id: <20060530121711.DEB012BAEA@webemail02.ibest.com.br> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I am doing a classification of the mimetype by comparing the end of the file name, like this: public static String getMimeType(String nomeArquivo) { String ret = null; if(nomeArquivo.endsWith(".avi")) { ret = "video/x-msvideo"; } else if (nomeArquivo.endsWith(".doc")) { ret = "application/msword"; } else if (nomeArquivo.endsWith(".htm")) { ret = "text/html"; } else if (nomeArquivo.endsWith(".html")) { ret = "text/html"; } else if (nomeArquivo.endsWith(".mht")) { ret = "text/html"; } else if (nomeArquivo.endsWith(".cfm")) { ret = "text/html"; } else if (nomeArquivo.endsWith(".jsp")) { ret = "text/html"; } else if (nomeArquivo.endsWith(".jspx")) { ret = "text/html"; } else if (nomeArquivo.endsWith(".pdf")) { ret = "application/pdf"; } else if (nomeArquivo.endsWith(".ppt")) { ret = "application/mspowerpoint"; } else if (nomeArquivo.endsWith(".rtf")) { ret = "application/rtf"; } else if (nomeArquivo.endsWith(".sxc")) { ret = "application/vnd.sun.xml.calc"; } else if (nomeArquivo.endsWith(".sxi")) { ret = "application/vnd.sun.xml.impress"; } else if (nomeArquivo.endsWith(".sxw")) { ret = "application/vnd.sun.xml.writer"; } else if (nomeArquivo.endsWith(".txt")) { ret = "text/plain"; } else if (nomeArquivo.endsWith(".xls")) { ret = "application/msexcel"; } else if (nomeArquivo.endsWith(".xml")) { ret = "text/xml"; } else if (nomeArquivo.endsWith(".xsl")) { ret = "text/xml"; } else if (nomeArquivo.endsWith(".java")) { ret = "text/plain"; } else if (nomeArquivo.endsWith(".bat")) { ret = "text/plain"; } else if (nomeArquivo.endsWith(".ods")) { ret = "application/vnd.oasis.opendocument.spreadsheet"; } else if (nomeArquivo.endsWith(".odt")) { ret = "application/vnd.oasis.opendocument.text"; } else if (nomeArquivo.endsWith(".odf")) { ret = "application/vnd.oasis.opendocument.formula"; } else if (nomeArquivo.endsWith(".odg")) { ret = "application/vnd.oasis.opendocument.graphics"; } else if (nomeArquivo.endsWith(".odd")) { ret = "application/vnd.oasis.opendocument.database"; } else if (nomeArquivo.endsWith(".odp")) { ret = "application/vnd.oasis.opendocument.presentation"; } return ret; } So, the jcr:mimeType gets the "correct" value when I am saving the nt:resource node. But I am searching any document I put there and there is no result, or if there is it is unstable for all the extensions the textfilters assume that it does. Normally I put the file inside a node (nt:resource) that is inside a nt:folder, and do the query: SELECT * FROM nt:folder WHERE CONTAINS(*,'TEXTSEARCHINGFOR') My repository xml does reference to textfilters. The textfilters are based on the information in the jcr:mimetype to build the index, no? Is there no way to rebuild the indexes without have to restart the jboss? I am not seeing this funcionallity works, but I need it working, what are the best pratice for that (if it exists). Thanks Helio >hsp wrote: >> I don't mind what could be happen, but my application doesn't search any >> values (properties or binary contents). If I do the simple query in >> XPath: //*[jcr:contains(.,'lidando')] > >can you provide a small test case that reproduces this behaviour? Thanks. > >> or the other: >> >> //*[jcr:like(@jcr:primaryType,'%nt:folder%')] > >JSR 170 specifies that jcr:like() does not work with properties of type >NAME. you should rather use the equals operator or the element node test: > >//*[@jcr:primaryType == 'nt:folder'] > (returns nodes that are of type nt:folder) > >//element(*, nt:folder) > (returns nodes that are of type nt:folder or of types that are derived >from nt:folder) > >regards > marcel >