Index: /gs3-extensions/fedora/README
===================================================================
--- /gs3-extensions/fedora/README	(revision 26390)
+++ /gs3-extensions/fedora/README	(revision 26391)
@@ -188,7 +188,28 @@
 Deleting a Fedora GS3 collection is accomplished with the following 2 steps:
 - Run the g2f-deletecol.pl script over the collection to be deleted. Assuming the collection is called fedora1, you'd run:
-	g2f-deletecol.pl -hostname localhost -port 8383 -password pounamu -removeold -collectdir /<GS3>/web/sites/localsite/collect fedora1
+	g2f-deletecol.pl -hostname localhost -port 8383 -password pounamu -collectdir /<GS3>/web/sites/localsite/collect fedora1
 - manually delete the Greenstone collection directory from the filesystem
 
+
+To run this manually, 
+- first remove the pids from the GSearch index:
+/<GS3>/packages/tomcat/webapps/fedoragsearch/client>/<GS3>/packages/tomcat/webapps/fedoragsearch/client/runRESTClient.sh localhost:8383 updateIndex deletePID greenstone:fedora1-HASH010313b14474bc72b296b15f
+
+It will ask for the fedoragsearch username and password, which by default are fedoraAdmin and pounamu, respectively.
+
+- then purge the necessary documents (pids) from the fedora repository:
+/<GS3>/ext/fedora3/client/bin>./fedora-purge.sh localhost:8383 fedoraAdmin pounamu greenstone:fedora1-HASHe14e36cba08bd41c663237 http "purging"
+
+- You can check it's all been deleted by visiting http://localhost:8383/fedora/search 
+and searching for:
+
+greenstone:*
+or greenstone:<colname>*
+
+Visit http://localhost:8383/fedoragsearch/rest?operation=browseIndex
+and browse the PID field
+
+You can also visit http://localhost:8383/fedoragsearch/rest?operation=gfindObjects
+then you can search for a query term by prefixing the index field to it, e.g ds.fulltext:computers 
 
 
@@ -222,5 +243,7 @@
 - @tomcatshutdownport@
 - @fedorapassw@
-Except for the first, which needs to be set when running the Fedora extension's ant targets, all the remaining ones can be specified 
+- @indexwritelocktimeout@
+
+Except for the first, which needs to be set when running the Fedora extension's ant targets, all the remaining ones can be specified in Greenstone 3's toplevel build.properties.
 
 
@@ -231,7 +254,9 @@
 - adjust_war_files/fedoragsearch/FgsConfig/FgsConfigIndexTemplate/Lucene/foxmlToLucene.xslt 
 - adjust_war_files/fedoragsearch/FgsConfig/FgsConfigIndexTemplate/Lucene/foxmlToLuceneGenerated.xslt
+- adjust_war_files/fedoragsearch/FgsConfig/FgsConfigIndexTemplate/Lucene/index.properties
 - adjust_war_files/fedoragsearch/client/runRESTClient.sh
 - adjust_war_files/fedoragsearch/client/runSOAPClient.sh
 - adjust_war_files/fedoragsearch/client/runSOAPClient.bat
+
 
 All these files will get copied into the same locations within <GS3>/packages/tomcat/webapps/fedoragsearch. The file fgsconfig-basic.properties.in will get copied as fgsconfig-basic.properties but with the previously-listed placeholder strings replaced.
@@ -333,4 +358,13 @@
 Further datastreams and metadata sets can be indexed by adding similar namespace declarations and xml elements to these 2 XSLT files. 
 If the changes are not meant to apply for all Greenstone users, individual Greenstone users can add fields for indexing by making such changes to just the file fedoragsearch/FgsConfig/FgsConfigIndexTemplate/Lucene/foxmlToLuceneGenerated.xslt
+
+
+d. By default, Lucene's lock obtain timeout is set to 0 in its properties file, which is not acceptable for all but the smallest documents. The lock timeout can be customised in build.properties and by default is set to 10000 (or 1000), which can be adjusted before starting the Fedora extension installation process.
+
+The installation process will write out this property into GSearch's FgsConfig/FgsConfigIndexTemplate/Lucene/index.properties: 
+	fgsindex.defaultWriteLockTimeout = 1000
+
+When fedoragsearch then gets deployed, this value will be propagated into: 
+	<GS3>/packages/tomcat/webapps/fedoragsearch/WEB-INF/classes/fgsconfigFinal/index/FgsIndex/index.properties
 
 
Index: /gs3-extensions/fedora/build.xml
===================================================================
--- /gs3-extensions/fedora/build.xml	(revision 26390)
+++ /gs3-extensions/fedora/build.xml	(revision 26391)
@@ -61,6 +61,8 @@
     <filter token="tomcatshutdownport" value="${tomcat.shutdown.port}"/>
     <filter token="fedorapassw" value="${fedora.password}"/>
-    
+    <filter token="indexwritelocktimeout" value="${index.writelock.timeout}"/>
+
     <copy file="${basedir}/adjust_war_files/fedoragsearch/FgsConfig/fgsconfig-basic.properties.in" tofile="${basedir}/adjust_war_files/fedoragsearch/FgsConfig/fgsconfig-basic.properties" filtering="true" overwrite="true"/>
+    <copy file="${basedir}/adjust_war_files/fedoragsearch/FgsConfig/FgsConfigIndexTemplate/Lucene/index.properties.in" tofile="${basedir}/adjust_war_files/fedoragsearch/FgsConfig/FgsConfigIndexTemplate/Lucene/index.properties" filtering="true" overwrite="true"/>
     <copy file="${basedir}/install/install.properties.in" tofile="${basedir}/install/install.properties" filtering="true" overwrite="true"/>
     <copy file="${basedir}/server/config/fedora.fcfg.in" tofile="${basedir}/server/config/fedora.fcfg" filtering="true" overwrite="true"/>
Index: /gs3-extensions/fedora/fedoragsearch-files/index.properties.in
===================================================================
--- /gs3-extensions/fedora/fedoragsearch-files/index.properties.in	(revision 26391)
+++ /gs3-extensions/fedora/fedoragsearch-files/index.properties.in	(revision 26391)
@@ -0,0 +1,140 @@
+# $Id: index.properties $
+
+fgsindex.indexName					= INDEXNAME
+
+fgsindex.operationsImpl				= dk.defxws.fgslucene.OperationsImpl
+
+fgsindex.defaultUpdateIndexDocXslt		= INDEXINGDOCXSLT
+fgsindex.defaultUpdateIndexResultXslt	= updateIndexToResultPage
+fgsindex.defaultGfindObjectsResultXslt	= gfindObjectsToResultPage
+fgsindex.defaultBrowseIndexResultXslt	= browseIndexToResultPage
+fgsindex.defaultGetIndexInfoResultXslt	= copyXml
+
+#fgsindex.indexDir				= <...> 
+fgsindex.indexDir				= INDEXDIR
+
+fgsindex.analyzer				= org.apache.lucene.analysis.standard.StandardAnalyzer
+fgsindex.fieldAnalyzers			= dc.title::org.apache.lucene.analysis.standard.StandardAnalyzer dc.creator::org.apache.lucene.analysis.standard.StandardAnalyzer
+# used to index and query TOKENIZED index fields
+# for UN_TOKENIZED index fields see fgsindex.untokenizedFields further down
+
+#Stopwords file for the analyzer, comment the line if no stopwords
+#fgsindex.stopwordsLocation      = /stopwords.txt
+ 
+fgsindex.defaultQueryFields		= dc.description dc.title
+
+# setting of org.apache.lucene.queryParser.QueryParser setAllowLeadingWildcard()
+# Set to true to allow leading wildcard characters, * or ?
+# Default: false. 
+fgsindex.allowLeadingWildcard	= false
+
+# setting of org.apache.lucene.queryParser.QueryParser setLowercaseExpandedTerms()
+# Whether terms of wildcard, prefix, fuzzy and range queries are to be automatically lower-cased or not. 
+# Default: true. 
+fgsindex.lowercaseExpandedTerms = true
+
+#sortFields may be given as parameter to gfindObjects, or as config default.
+###########
+
+# as parameter:			?operation=gfindObjects&sortFields=[sortFieldsValue]&...
+
+# as config default:
+
+#fgsindex.defaultSortFields			= sortFieldsValue
+
+#examples:
+
+#fgsindex.defaultSortFields			= PID,STRING,true
+
+#fgsindex.defaultSortFields			= sf1,SCORE;sf2,cy-GB-var,true
+
+#    sortFieldsValue	::= [sortField[';'sortField]*]
+#    sortField  		::= sortFieldName[','(sortType | locale | comparatorClass)[','reverse]]]]
+#    sortFieldName		::= #the name of an index field, which is UN_TOKENIZED and contains a single term per document
+#    sortType			::= 'BYTE' | 'DOC' | 'DOUBLE' | 'FLOAT' | 'INT' | 'LONG' | 'SCORE' | 'SHORT' | 'STRING' | 'STRING_VAL'
+#    locale				::= language['-'country['-'variant]]
+#    comparatorClass    ::= package-path'.'className['('param['-'param]*')']
+#    reverse			::= 'false' (default) | 'true' | 'reverse'
+
+#    sortType 'AUTO' is removed in Lucene 3.x
+
+# The test class dk.defxws.fedoragsearch.test.ComparatorSourceTest has been removed in GSearch 2.3,
+# because the interface org.apache.lucene.search.SortComparatorSource is deprecated in Lucene 3.x
+
+# Briefly, one or more sortFields will determine the sequence of search results,
+# as defined either by sortType or by locale, and it may be in reverse.
+
+# If no sortFieldsValue is given, then this code from GSearch is run
+
+#   TopDocs hits = searcher.search(query, numHits); // in dk.defxws.fgslucene.Statement.java
+  
+# where the sequence is by default.
+
+# If a sortFieldsValue is given, then this code is run
+
+#   TopDocs hits = searcher.search(query, numHits, sort); 
+
+# where sort is an instance of org.apache.lucene.search.Sort, see
+
+#   http://lucene.apache.org/java/3_3_0/api/index.html
+
+# See org.apache.lucene.search.SortField for more about sortType, locale and reverse values.
+
+
+#fgsindex.untokenizedFields		= list of index fields created as UN_TOKENIZED
+###########################
+#									Effect: during search the KeywordAnalyzer is used for untokenized fields,
+#									while the fgsindex.analyzer is used for other fields.
+#									Only untokenized fields, which do not occur in every index document,
+#									need be listed here.
+# example:
+
+#fgsindex.untokenizedFields		= fgs.contentModel uf1 uf2
+fgsindex.untokenizedFields		= PID
+
+
+# snippets
+##########
+#fgsindex.snippetBegin	= <span class=\"highlight\">
+fgsindex.snippetBegin	= <span class=\"highlight\">
+## this value is default if not specified
+#fgsindex.snippetEnd	= </span>
+fgsindex.snippetEnd	= </span>
+## this value is default if not specified
+
+
+# optimization  see e.g. http://www.onjava.com/pub/a/onjava/2003/03/05/lucene.html
+##############
+# fgsindex.mergeFactor		= 10
+fgsindex.mergeFactor		= 100
+## 10 is default if not specified
+# fgsindex.maxBufferedDocs	= 10
+fgsindex.maxBufferedDocs	= 100
+## 10 is default if not specified
+# fgsindex.defaultWriteLockTimeout	= 1000
+#fgsindex.defaultWriteLockTimeout	= 0
+fgsindex.defaultWriteLockTimeout	= @indexwritelocktimeout@
+## 0 is default if not specified
+# from http://lucene.apache.org/java/2_3_0/api/IndexWriter.html :
+## mergeFactor
+##   determines how often segment indices are merged by addDocument(). 
+##   With smaller values, less RAM is used while indexing, and searches on unoptimized indices are faster, 
+##   but indexing speed is slower. With larger values, more RAM is used during indexing, 
+##   and while searches on unoptimized indices are slower, indexing is faster. 
+##   Thus larger values (> 10) are best for batch index creation, 
+##   and smaller values (< 10) for indices that are interactively maintained.
+## maxBufferedDocs 
+##   determines the minimal number of documents required 
+##   before the buffered in-memory documents are merged and a new Segment is created. 
+##   Since Documents are merged in a RAMDirectory, large value gives faster indexing. 
+##   At the same time, mergeFactor limits the number of files open in a FSDirectory.
+## defaultWriteLockTimeout 
+##   sets the default maximum time to wait for a write lock (in milliseconds). 
+
+#  ...?operation=updateIndex&action=optimize
+##        will perform IndexWriter.optimize()
+##        which merges all segments together into a single segment, optimizing an index for search.
+
+# custom URIResolver
+####################
+#fgsindex.uriResolver	= dk.defxws.fedoragsearch.server.URIResolverImpl
Index: /gs3-extensions/fedora/fedoragsearch-files/web.xml
===================================================================
--- /gs3-extensions/fedora/fedoragsearch-files/web.xml	(revision 26390)
+++ /gs3-extensions/fedora/fedoragsearch-files/web.xml	(revision 26391)
@@ -88,5 +88,6 @@
       <url-pattern>/*</url-pattern>
     </filter-mapping>
-<!--    <filter-mapping>
+<!--
+    <filter-mapping>
       <filter-name>EnforceAuthnFilter</filter-name>
       <servlet-name>AxisServlet</servlet-name>
