Author: jcouteau Date: 2011-04-12 10:26:26 +0200 (Tue, 12 Apr 2011) New Revision: 784 Url: http://nuiton.org/repositories/revision/wikitty/784 Log: Evolution #1429: Update to solr 3.1.0 - Everything works fine except tree indexation, test will fail Add license on files Removed: trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/RAMDirectoryFactory.java Modified: trunk/pom.xml trunk/src/site/rst/user/faq.rst trunk/src/site/rst/user/search.rst trunk/src/site/rst/user/security.rst trunk/wikitty-api/src/main/java/org/nuiton/wikitty/ScriptEvaluator.java trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/operators/False.java trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/operators/Like.java trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/operators/True.java trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/operators/Unlike.java trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceHook.java trunk/wikitty-api/src/main/resources/wikitty-config-sample-inmemory.properties trunk/wikitty-api/src/site/rst/dataModel.rst trunk/wikitty-api/src/test/java/org/nuiton/wikitty/api/AbstractSearchTest.java trunk/wikitty-api/src/test/java/org/nuiton/wikitty/api/InMemorySearchTest.java trunk/wikitty-jdbc-impl/src/main/java/org/nuiton/wikitty/services/WikittyServiceInMemoryJdbcSolr.java trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/WikittyPublication.java trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/WikittyPublicationFileSystem.java trunk/wikitty-solr-impl/pom.xml trunk/wikitty-solr-impl/src/main/resources/schema.xml trunk/wikitty-solr-impl/src/main/resources/solrconfig.xml trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/SolrSearch2Test.java trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/TreeTest.java Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2011-04-11 16:02:52 UTC (rev 783) +++ trunk/pom.xml 2011-04-12 08:26:26 UTC (rev 784) @@ -156,21 +156,21 @@ <dependency> <groupId>org.apache.solr</groupId> <artifactId>solr-core</artifactId> - <version>1.4.1</version> + <version>3.1.0</version> <scope>compile</scope> </dependency> <dependency> <groupId>org.apache.solr</groupId> <artifactId>solr-solrj</artifactId> - <version>1.4.1</version> + <version>3.1.0</version> <scope>compile</scope> </dependency> <dependency> <groupId>org.apache.lucene</groupId> <artifactId>lucene-core</artifactId> - <version>2.9.4</version> + <version>3.1.0</version> <scope>compile</scope> </dependency> Modified: trunk/src/site/rst/user/faq.rst =================================================================== --- trunk/src/site/rst/user/faq.rst 2011-04-11 16:02:52 UTC (rev 783) +++ trunk/src/site/rst/user/faq.rst 2011-04-12 08:26:26 UTC (rev 784) @@ -1,3 +1,27 @@ +.. - +.. * #%L +.. * Wikitty +.. * +.. * $Id$ +.. * $HeadURL$ +.. * %% +.. * Copyright (C) 2009 - 2011 CodeLutin +.. * %% +.. * This program is free software: you can redistribute it and/or modify +.. * it under the terms of the GNU Lesser General Public License as +.. * published by the Free Software Foundation, either version 3 of the +.. * License, or (at your option) any later version. +.. * +.. * This program is distributed in the hope that it will be useful, +.. * but WITHOUT ANY WARRANTY; without even the implied warranty of +.. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.. * GNU General Lesser Public License for more details. +.. * +.. * You should have received a copy of the GNU General Lesser Public +.. * License along with this program. If not, see +.. * <http://www.gnu.org/licenses/lgpl-3.0.html>. +.. * #L% +.. - ========================= FAQ - Foire aux questions ========================= Modified: trunk/src/site/rst/user/search.rst =================================================================== --- trunk/src/site/rst/user/search.rst 2011-04-11 16:02:52 UTC (rev 783) +++ trunk/src/site/rst/user/search.rst 2011-04-12 08:26:26 UTC (rev 784) @@ -1,3 +1,27 @@ +.. - +.. * #%L +.. * Wikitty +.. * +.. * $Id$ +.. * $HeadURL$ +.. * %% +.. * Copyright (C) 2009 - 2011 CodeLutin +.. * %% +.. * This program is free software: you can redistribute it and/or modify +.. * it under the terms of the GNU Lesser General Public License as +.. * published by the Free Software Foundation, either version 3 of the +.. * License, or (at your option) any later version. +.. * +.. * This program is distributed in the hope that it will be useful, +.. * but WITHOUT ANY WARRANTY; without even the implied warranty of +.. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.. * GNU General Lesser Public License for more details. +.. * +.. * You should have received a copy of the GNU General Lesser Public +.. * License along with this program. If not, see +.. * <http://www.gnu.org/licenses/lgpl-3.0.html>. +.. * #L% +.. - ====================== Recherche avec Wikitty ====================== Modified: trunk/src/site/rst/user/security.rst =================================================================== --- trunk/src/site/rst/user/security.rst 2011-04-11 16:02:52 UTC (rev 783) +++ trunk/src/site/rst/user/security.rst 2011-04-12 08:26:26 UTC (rev 784) @@ -1,3 +1,27 @@ +.. - +.. * #%L +.. * Wikitty +.. * +.. * $Id$ +.. * $HeadURL$ +.. * %% +.. * Copyright (C) 2009 - 2011 CodeLutin +.. * %% +.. * This program is free software: you can redistribute it and/or modify +.. * it under the terms of the GNU Lesser General Public License as +.. * published by the Free Software Foundation, either version 3 of the +.. * License, or (at your option) any later version. +.. * +.. * This program is distributed in the hope that it will be useful, +.. * but WITHOUT ANY WARRANTY; without even the implied warranty of +.. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.. * GNU General Lesser Public License for more details. +.. * +.. * You should have received a copy of the GNU General Lesser Public +.. * License along with this program. If not, see +.. * <http://www.gnu.org/licenses/lgpl-3.0.html>. +.. * #L% +.. - Utiliser la sécurité dans Wikitty ================================= Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/ScriptEvaluator.java =================================================================== --- trunk/wikitty-api/src/main/java/org/nuiton/wikitty/ScriptEvaluator.java 2011-04-11 16:02:52 UTC (rev 783) +++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/ScriptEvaluator.java 2011-04-12 08:26:26 UTC (rev 784) @@ -1,3 +1,27 @@ +/* + * #%L + * Wikitty :: api + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2011 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ package org.nuiton.wikitty; Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/operators/False.java =================================================================== --- trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/operators/False.java 2011-04-11 16:02:52 UTC (rev 783) +++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/operators/False.java 2011-04-12 08:26:26 UTC (rev 784) @@ -1,3 +1,27 @@ +/* + * #%L + * Wikitty :: api + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2011 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ package org.nuiton.wikitty.search.operators; import java.io.Serializable; Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/operators/Like.java =================================================================== --- trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/operators/Like.java 2011-04-11 16:02:52 UTC (rev 783) +++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/operators/Like.java 2011-04-12 08:26:26 UTC (rev 784) @@ -1,3 +1,27 @@ +/* + * #%L + * Wikitty :: api + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2011 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ package org.nuiton.wikitty.search.operators; import java.io.Serializable; Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/operators/True.java =================================================================== --- trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/operators/True.java 2011-04-11 16:02:52 UTC (rev 783) +++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/operators/True.java 2011-04-12 08:26:26 UTC (rev 784) @@ -1,3 +1,27 @@ +/* + * #%L + * Wikitty :: api + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2011 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ package org.nuiton.wikitty.search.operators; import java.io.Serializable; Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/operators/Unlike.java =================================================================== --- trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/operators/Unlike.java 2011-04-11 16:02:52 UTC (rev 783) +++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/operators/Unlike.java 2011-04-12 08:26:26 UTC (rev 784) @@ -1,3 +1,27 @@ +/* + * #%L + * Wikitty :: api + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2011 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ package org.nuiton.wikitty.search.operators; import java.io.Serializable; Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceHook.java =================================================================== --- trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceHook.java 2011-04-11 16:02:52 UTC (rev 783) +++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceHook.java 2011-04-12 08:26:26 UTC (rev 784) @@ -1,3 +1,27 @@ +/* + * #%L + * Wikitty :: api + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2011 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ package org.nuiton.wikitty.services; Modified: trunk/wikitty-api/src/main/resources/wikitty-config-sample-inmemory.properties =================================================================== --- trunk/wikitty-api/src/main/resources/wikitty-config-sample-inmemory.properties 2011-04-11 16:02:52 UTC (rev 783) +++ trunk/wikitty-api/src/main/resources/wikitty-config-sample-inmemory.properties 2011-04-12 08:26:26 UTC (rev 784) @@ -39,7 +39,7 @@ wikitty.WikittyServiceStorage.components=org.nuiton.wikitty.jdbc.WikittyExtensionStorageJDBC,\ org.nuiton.wikitty.jdbc.WikittyStorageJDBC,\ org.nuiton.wikitty.storage.solr.WikittySearchEngineSolr -wikitty.searchengine.solr.directory.factory=org.nuiton.wikitty.storage.solr.RAMDirectoryFactory +wikitty.searchengine.solr.directory.factory=org.apache.solr.core.RAMDirectoryFactory wikitty.service.cache.allwaysRestoreCopies=false wikitty.service.event.propagate=false wikitty.service.event.listen=false Modified: trunk/wikitty-api/src/site/rst/dataModel.rst =================================================================== --- trunk/wikitty-api/src/site/rst/dataModel.rst 2011-04-11 16:02:52 UTC (rev 783) +++ trunk/wikitty-api/src/site/rst/dataModel.rst 2011-04-12 08:26:26 UTC (rev 784) @@ -1,3 +1,27 @@ +.. - +.. * #%L +.. * Wikitty :: api +.. * +.. * $Id$ +.. * $HeadURL$ +.. * %% +.. * Copyright (C) 2009 - 2011 CodeLutin +.. * %% +.. * This program is free software: you can redistribute it and/or modify +.. * it under the terms of the GNU Lesser General Public License as +.. * published by the Free Software Foundation, either version 3 of the +.. * License, or (at your option) any later version. +.. * +.. * This program is distributed in the hope that it will be useful, +.. * but WITHOUT ANY WARRANTY; without even the implied warranty of +.. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.. * GNU General Lesser Public License for more details. +.. * +.. * You should have received a copy of the GNU General Lesser Public +.. * License along with this program. If not, see +.. * <http://www.gnu.org/licenses/lgpl-3.0.html>. +.. * #L% +.. - ==================== Le modèle de données ==================== Modified: trunk/wikitty-api/src/test/java/org/nuiton/wikitty/api/AbstractSearchTest.java =================================================================== --- trunk/wikitty-api/src/test/java/org/nuiton/wikitty/api/AbstractSearchTest.java 2011-04-11 16:02:52 UTC (rev 783) +++ trunk/wikitty-api/src/test/java/org/nuiton/wikitty/api/AbstractSearchTest.java 2011-04-12 08:26:26 UTC (rev 784) @@ -1,3 +1,27 @@ +/* + * #%L + * Wikitty :: api + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2011 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ package org.nuiton.wikitty.api; import org.junit.Assert; Modified: trunk/wikitty-api/src/test/java/org/nuiton/wikitty/api/InMemorySearchTest.java =================================================================== --- trunk/wikitty-api/src/test/java/org/nuiton/wikitty/api/InMemorySearchTest.java 2011-04-11 16:02:52 UTC (rev 783) +++ trunk/wikitty-api/src/test/java/org/nuiton/wikitty/api/InMemorySearchTest.java 2011-04-12 08:26:26 UTC (rev 784) @@ -1,3 +1,27 @@ +/* + * #%L + * Wikitty :: api + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2011 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ package org.nuiton.wikitty.api; import org.nuiton.wikitty.WikittyConfig; Modified: trunk/wikitty-jdbc-impl/src/main/java/org/nuiton/wikitty/services/WikittyServiceInMemoryJdbcSolr.java =================================================================== --- trunk/wikitty-jdbc-impl/src/main/java/org/nuiton/wikitty/services/WikittyServiceInMemoryJdbcSolr.java 2011-04-11 16:02:52 UTC (rev 783) +++ trunk/wikitty-jdbc-impl/src/main/java/org/nuiton/wikitty/services/WikittyServiceInMemoryJdbcSolr.java 2011-04-12 08:26:26 UTC (rev 784) @@ -29,11 +29,11 @@ import java.util.UUID; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.apache.solr.core.RAMDirectoryFactory; import org.nuiton.util.ApplicationConfig; import org.nuiton.wikitty.WikittyConfig; import org.nuiton.wikitty.jdbc.WikittyExtensionStorageJDBC; import org.nuiton.wikitty.jdbc.WikittyStorageJDBC; -import org.nuiton.wikitty.storage.solr.RAMDirectoryFactory; import org.nuiton.wikitty.storage.solr.WikittySearchEngineSolr; /** Modified: trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/WikittyPublication.java =================================================================== --- trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/WikittyPublication.java 2011-04-11 16:02:52 UTC (rev 783) +++ trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/WikittyPublication.java 2011-04-12 08:26:26 UTC (rev 784) @@ -1,3 +1,27 @@ +/* + * #%L + * Wikitty :: publication + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2010 - 2011 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ package org.nuiton.wikitty.publication; import java.io.File; Modified: trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/WikittyPublicationFileSystem.java =================================================================== --- trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/WikittyPublicationFileSystem.java 2011-04-11 16:02:52 UTC (rev 783) +++ trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/WikittyPublicationFileSystem.java 2011-04-12 08:26:26 UTC (rev 784) @@ -1,3 +1,27 @@ +/* + * #%L + * Wikitty :: publication + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2010 - 2011 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ package org.nuiton.wikitty.publication; import java.io.BufferedInputStream; Modified: trunk/wikitty-solr-impl/pom.xml =================================================================== --- trunk/wikitty-solr-impl/pom.xml 2011-04-11 16:02:52 UTC (rev 783) +++ trunk/wikitty-solr-impl/pom.xml 2011-04-12 08:26:26 UTC (rev 784) @@ -46,6 +46,12 @@ <dependency> <groupId>org.apache.solr</groupId> <artifactId>solr-core</artifactId> + <exclusions> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-jdk14</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> Deleted: trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/RAMDirectoryFactory.java =================================================================== --- trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/RAMDirectoryFactory.java 2011-04-11 16:02:52 UTC (rev 783) +++ trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/RAMDirectoryFactory.java 2011-04-12 08:26:26 UTC (rev 784) @@ -1,143 +0,0 @@ -/** - * %%Ignore-License - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.nuiton.wikitty.storage.solr; - -import java.io.File; -import java.util.HashMap; -import java.util.Map; -import org.apache.lucene.store.LockFactory; - -import org.apache.solr.core.StandardDirectoryFactory; -import java.io.IOException; -import java.util.concurrent.atomic.AtomicInteger; - -import org.apache.lucene.store.Directory; -import org.apache.lucene.store.RAMDirectory; -import org.apache.lucene.store.SingleInstanceLockFactory; - -/** - * Directory provider for using lucene RAMDirectory - * - * Only exists in version 4.0 of solr, but we used 1.4.1. Remove this class - * when solr 4.0 will be used - */ -public class RAMDirectoryFactory extends StandardDirectoryFactory { - - private static Map<String, RefCntRamDirectory> directories = new HashMap<String, RefCntRamDirectory>(); - - @Override - public Directory open(String path) throws IOException { - synchronized (RAMDirectoryFactory.class) { - RefCntRamDirectory directory = directories.get(path); - if (directory == null || !directory.isOpen()) { - directory = (RefCntRamDirectory) openNew(path); - directories.put(path, directory); - } else { - directory.incRef(); - } - - return directory; - } - } - - public boolean exists(String path) { - synchronized (RAMDirectoryFactory.class) { - RefCntRamDirectory directory = directories.get(path); - if (directory == null || !directory.isOpen()) { - return false; - } else { - return true; - } - } - } - - /** - * Non-public for unit-test access only. Do not use directly - */ - Directory openNew(String path) throws IOException { - Directory directory; - File dirFile = new File(path); - boolean indexExists = dirFile.canRead(); - if (indexExists) { - Directory dir = super.open(path); - directory = new RefCntRamDirectory(dir); - } else { - directory = new RefCntRamDirectory(); - } - return directory; - } - - static public class RefCntRamDirectory extends RAMDirectory { - - private final AtomicInteger refCount = new AtomicInteger(); - - public RefCntRamDirectory() { - super(); - refCount.set(1); - } - - public RefCntRamDirectory(Directory dir) throws IOException { - this(); - // CODELUTIN - Directory.copy(dir, this, false); -// for (String file : dir.listAll()) { -// dir.copy(this, file, file); -// } - // CODELUTIN - } - - // CODELUTIN - @Override - public void setLockFactory(LockFactory lockFactory) { - // on accept que SingleInstanceLockFactory, sinon on ecrit - // des locks sur disque ce qui cree le repertoire index - // et ensuite on croit que l'index existe et donc s'initialise mal - // puisque le repertoire est en fait vide - - // cela provient de la methode dans SolrIndexWriter - // public static Directory getDirectory(...) - // qui instancie bien un RAMDirectory, mais ensuite change le - // LockFactory avec celui trouve dans le fichier de config, fait - // pour les autre Directory de type FS - if (lockFactory instanceof SingleInstanceLockFactory) { - super.setLockFactory(lockFactory); - } - } - // CODELUTIN - - public void incRef() { - ensureOpen(); - refCount.incrementAndGet(); - } - - public void decRef() { - ensureOpen(); - if (refCount.getAndDecrement() == 1) { - super.close(); - } - } - - public final synchronized void close() { - decRef(); - } - - public boolean isOpen() { - return isOpen; - } - } -} Modified: trunk/wikitty-solr-impl/src/main/resources/schema.xml =================================================================== --- trunk/wikitty-solr-impl/src/main/resources/schema.xml 2011-04-11 16:02:52 UTC (rev 783) +++ trunk/wikitty-solr-impl/src/main/resources/schema.xml 2011-04-12 08:26:26 UTC (rev 784) @@ -32,6 +32,7 @@ --> <schema name="wikitty" version="1.1"> + <types> <!-- BINARY type: ignared --> <fieldtype name="binary" stored="false" indexed="false" class="solr.StrField" /> @@ -53,18 +54,18 @@ <!-- STRING type: The StrField type is not analyzed, but indexed/stored verbatim. --> <fieldType name="string" class="solr.StrField" - compressed="true" compressThreshold="1000" + compressThreshold="1000" sortMissingLast="true" omitNorms="true"/> <!-- STRING type copy: type to string all text is lower cased --> <fieldType name="string_lc" class="solr.StrField" - compressed="true" compressThreshold="1000" + compressThreshold="1000" sortMissingLast="true"> - <analyzer> <!-- no type to indicated that used it for both type: index and query --> - <tokenizer class="solr.StandardTokenizerFactory"/> + <!--analyzer!--> <!-- no type to indicated that used it for both type: index and query --> + <!--<tokenizer class="solr.StandardTokenizerFactory"/> <filter class="solr.ASCIIFoldingFilterFactory"/> <filter class="solr.LowerCaseFilterFactory"/> - </analyzer> + </analyzer>--> </fieldType> <!-- STRING type copy @@ -76,7 +77,7 @@ WordDelim parts) are removed. --> <fieldType name="text" class="solr.TextField" - compressed="true" compressThreshold="1000" + compressThreshold="1000" positionIncrementGap="100"> <analyzer type="index"> <tokenizer class="solr.WhitespaceTokenizerFactory"/> @@ -91,7 +92,7 @@ catenateNumbers="1" catenateAll="0" splitOnCaseChange="1" preserveOriginal="1"/> <filter class="solr.LowerCaseFilterFactory"/> - <filter class="solr.EnglishPorterFilterFactory" + <filter class="solr.SnowballPorterFilterFactory" protected="protwords.txt"/> <filter class="solr.RemoveDuplicatesTokenFilterFactory"/> </analyzer> @@ -107,7 +108,7 @@ catenateNumbers="0" catenateAll="0" splitOnCaseChange="1" preserveOriginal="1"/> <filter class="solr.LowerCaseFilterFactory"/> - <filter class="solr.EnglishPorterFilterFactory" + <filter class="solr.SnowballPorterFilterFactory" protected="protwords.txt"/> <filter class="solr.RemoveDuplicatesTokenFilterFactory"/> </analyzer> Modified: trunk/wikitty-solr-impl/src/main/resources/solrconfig.xml =================================================================== --- trunk/wikitty-solr-impl/src/main/resources/solrconfig.xml 2011-04-11 16:02:52 UTC (rev 783) +++ trunk/wikitty-solr-impl/src/main/resources/solrconfig.xml 2011-04-12 08:26:26 UTC (rev 784) @@ -25,6 +25,9 @@ --> <config> + + <luceneMatchVersion>LUCENE_31</luceneMatchVersion> + <!-- Set this to 'false' if you want solr to continue working after it has encountered an severe configuration error. In a production environment, you may want solr to keep working even if one handler is mis-configured. @@ -515,29 +518,29 @@ - - - <highlighting> - <!-- Configure the standard fragmenter --> - <!-- This could most likely be commented out in the "default" case --> +<!-- TODO JC 2011-04-12 Commented when migrating to solr 3.1.0. Is this useful ? --> +<!--Highlighting should be moved to searchComponents--> + <!-- <highlighting> + <!– Configure the standard fragmenter –> + <!– This could most likely be commented out in the "default" case –> <fragmenter name="gap" class="org.apache.solr.highlight.GapFragmenter" default="true"> <lst name="defaults"> <int name="hl.fragsize">100</int> </lst> </fragmenter> - <!-- A regular-expression-based fragmenter (f.i., for sentence extraction) --> + <!– A regular-expression-based fragmenter (f.i., for sentence extraction) –> <fragmenter name="regex" class="org.apache.solr.highlight.RegexFragmenter"> <lst name="defaults"> - <!-- slightly smaller fragsizes work better because of slop --> + <!– slightly smaller fragsizes work better because of slop –> <int name="hl.fragsize">70</int> - <!-- allow 50% slop on fragment sizes --> + <!– allow 50% slop on fragment sizes –> <float name="hl.regex.slop">0.5</float> - <!-- a basic sentence pattern --> + <!– a basic sentence pattern –> <str name="hl.regex.pattern">[-\w ,/\n\"']{20,200}</str> </lst> </fragmenter> - </highlighting> + </highlighting>--> <queryParser name="lucene" class="org.nuiton.wikitty.storage.solr.WikittyQueryParser"/> <queryParser name="wikitty" class="org.nuiton.wikitty.storage.solr.WikittyQueryParser"/> Modified: trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/SolrSearch2Test.java =================================================================== --- trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/SolrSearch2Test.java 2011-04-11 16:02:52 UTC (rev 783) +++ trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/SolrSearch2Test.java 2011-04-12 08:26:26 UTC (rev 784) @@ -1,3 +1,27 @@ +/* + * #%L + * Wikitty :: wikitty-solr-impl + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2011 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ package org.nuiton.wikitty.storage.solr; import org.nuiton.wikitty.WikittyConfig; Modified: trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/TreeTest.java =================================================================== --- trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/TreeTest.java 2011-04-11 16:02:52 UTC (rev 783) +++ trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/TreeTest.java 2011-04-12 08:26:26 UTC (rev 784) @@ -279,7 +279,7 @@ } @Test - public void testHiearchicalFacet() throws Exception { + public void testHierarchicalFacet() throws Exception { Wikitty root = findNode("root"); int sum = sum(root); assertEquals(6, sum);