# SINCE 0.5.0 \r
web.allowZipDownloads = true\r
\r
+# Allow optional Lucene integration. Lucene indexing is an opt-in feature.\r
+# A repository may specify branches to index with Lucene instead of using Git\r
+# commit traversal. There are scenarios where you may want to completely disable\r
+# Lucene indexing despite a repository specifying indexed branches. One such\r
+# scenario is on a resource-constrained federated Gitblit mirror.\r
+#\r
+# SINCE 0.9.0\r
+web.allowLuceneIndexing = true\r
+\r
# Use Clippy (Flash solution) to provide a copy-to-clipboard button.\r
# If false, a button with a more primitive JavaScript-based prompt box will\r
# offer a 3-step (click, ctrl+c, enter) copy-to-clipboard alternative.\r
\r
### How do I use it?\r
\r
-Lucene indexing is an opt-in feature which means that no repositories are automatically indexed. \r
+First you must ensure that *web.allowLuceneIndexing* is set *true* in `gitblit.properties` or `web.xml`. Then you must understand that Lucene indexing is an opt-in feature which means that no repositories are automatically indexed. \r
Like anything else, this design has pros and cons.\r
\r
#### Pros\r
-1. no wasted cycles on repositories you will never search\r
+1. no wasted cycles indexing repositories you will never search\r
2. you specify exactly what branches are indexed; experimental/dead/personal branches can be ignored\r
\r
#### Cons\r
**NOTE:** \r
After specifying branches, only the content from those branches can be searched via Gitblit. Gitblit will automatically redirect any queries entered on a repository's search box to the Lucene search page. Repositories that do not specify any indexed branches will use the traditional commit-traversal search.\r
\r
+#### Adequate Heap\r
+\r
+The initial indexing of an existing repository can potentially exhaust the memory allocated to your Java instance and may throw OutOfMemory exceptions. Be sure to provide your Gitblit server adequate heap space to index your repositories. The heap is set using the *-Xmx* JVM parameter in your Gitblit launch command (e.g. -Xmx1024M).\r
+\r
## Client Setup and Configuration\r
### Https with Self-Signed Certificates\r
You must tell Git/JGit not to verify the self-signed certificate in order to perform any remote Git operations.\r
#### additions\r
\r
- Added optional Lucene branch indexing (issue 16) \r
+ **New:** *web.allowLuceneIndexing = true* \r
**New:** *web.luceneIgnoreExtensions = 7z arc arj bin bmp dll doc docx exe gif gz jar jpg lib lzh odg odf odt pdf ppt png so swf xcf xls xlsx zip* \r
Repository branches may be optionally indexed by Lucene for improved searching. To use this feature you must specify which branches to index within the *Edit Repository* page; _no repositories are automatically indexed_. Gitblit will build or incrementally update enrolled repositories on a 2 minute cycle. (i.e you will have to wait 2-3 minutes after respecifying indexed branches or pushing new commits before Gitblit will build/update the repository's Lucene index.) \r
If a repository has Lucene-indexed branches the *search* form on the repository pages will redirect to the root-level Lucene search page and only the content of those branches can be searched. \r
-If the repository does not specify any indexed branches then repository commit-traversal search is used.\r
+If the repository does not specify any indexed branches then repository commit-traversal search is used. \r
+**Note:** Initial indexing of an existing repository can be memory-exhaustive. Be sure to provide your Gitblit server adequate heap space to index your repositories (e.g. -Xmx1024M).\r
- Allow specifying timezone to use for Gitblit which is independent of both the JVM and the system timezone (issue 54) \r
**New:** *web.timezone =* \r
- Added a built-in AJP connector for integrating Gitblit GO into an Apache mod_proxy setup (issue 59) \r
}\r
\r
div.searchResult .text {\r
- border-left: 5px solid #EEEEEE;\r
+ border-left: 2px solid #ccc;\r
+ border-radius: 0px;\r
\r
padding: 0 0 0 15px;\r
}\r
*/\r
@Override\r
public void run() {\r
+ if (!storedSettings.getBoolean(Keys.web.allowLuceneIndexing, true)) {\r
+ // Lucene indexing is disabled\r
+ return;\r
+ }\r
// reload the excluded extensions\r
String exts = storedSettings.getString(Keys.web.luceneIgnoreExtensions, luceneIgnoreExtensions);\r
excludedExtensions = new TreeSet<String>(StringUtils.getStringsFromValue(exts));\r
gb.indexedBranchesDescription = select the branches to include in your Lucene index\r
gb.noIndexedRepositoriesWarning = none of your repositories are configured for Lucene indexing\r
gb.undefinedQueryWarning = query is undefined!\r
-gb.noSelectedRepositoriesWarning = please select one or more repositories!
\ No newline at end of file
+gb.noSelectedRepositoriesWarning = please select one or more repositories!\r
+gb.luceneDisabled = Lucene indexing is disabled
\ No newline at end of file
\r
// indexed local branches palette\r
List<String> allLocalBranches = repositoryModel.getLocalBranches();\r
-\r
+ boolean luceneEnabled = GitBlit.getBoolean(Keys.web.allowLuceneIndexing, true);\r
final Palette<String> indexedBranchesPalette = new Palette<String>("indexedBranches", new ListModel<String>(\r
indexedBranches), new CollectionModel<String>(allLocalBranches),\r
new StringChoiceRenderer(), 8, false);\r
- indexedBranchesPalette.setEnabled(allLocalBranches.size() > 0);\r
-\r
+ indexedBranchesPalette.setEnabled(luceneEnabled && (allLocalBranches.size() > 0));\r
\r
// federation sets palette\r
List<String> sets = GitBlit.getStrings(Keys.federation.sets);\r
availableRepositories.add(model.name);\r
}\r
}\r
- \r
- if (availableRepositories.size() == 0) {\r
- info(getString("gb.noIndexedRepositoriesWarning"));\r
+ boolean luceneEnabled = GitBlit.getBoolean(Keys.web.allowLuceneIndexing, true);\r
+ if (luceneEnabled) {\r
+ if (availableRepositories.size() == 0) {\r
+ info(getString("gb.noIndexedRepositoriesWarning"));\r
+ }\r
+ } else {\r
+ error(getString("gb.luceneDisabled"));\r
}\r
\r
// enforce user-accessible repository selections\r
ListMultipleChoice<String> selections = new ListMultipleChoice<String>("repositories", \r
repositoriesModel, availableRepositories, new StringChoiceRenderer());\r
selections.setMaxRows(8);\r
- form.add(selections);\r
- form.add(new TextField<String>("query", queryModel));\r
- add(form);\r
+ form.add(selections.setEnabled(luceneEnabled));\r
+ form.add(new TextField<String>("query", queryModel).setEnabled(luceneEnabled));\r
+ add(form.setEnabled(luceneEnabled));\r
\r
// execute search\r
final List<SearchResult> results = new ArrayList<SearchResult>();\r
}\r
Class<? extends BasePage> searchPageClass = GitSearchPage.class;\r
RepositoryModel model = GitBlit.self().getRepositoryModel(repositoryName);\r
- if (!ArrayUtils.isEmpty(model.indexedBranches)) {\r
+ if (GitBlit.getBoolean(Keys.web.allowLuceneIndexing, true)\r
+ && !ArrayUtils.isEmpty(model.indexedBranches)) {\r
// this repository is Lucene-indexed\r
searchPageClass = LuceneSearchPage.class;\r
}\r
pages.add(new PageRegistration("gb.repositories", RepositoriesPage.class,\r
getRootPageParameters()));\r
pages.add(new PageRegistration("gb.activity", ActivityPage.class, getRootPageParameters()));\r
- pages.add(new PageRegistration("gb.search", LuceneSearchPage.class));\r
+ if (GitBlit.getBoolean(Keys.web.allowLuceneIndexing, true)) {\r
+ pages.add(new PageRegistration("gb.search", LuceneSearchPage.class));\r
+ }\r
if (showAdmin) {\r
pages.add(new PageRegistration("gb.users", UsersPage.class));\r
}\r