• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
sharadchhetri

sharadchhetri

Tutorials On Linux, Unix & Open Source

  • Home
  • Linux Commands
  • Resources
    • Learn Linux
  • My WordPress plugins

Reindex lucene search in owncloud 5.0.22

November 15, 2013 by Sharad Chhetri Leave a Comment

In this post we will learn about how to reindex lucene search in Owncloud 5.0.22. While working in Owncloud 5.0.22 our requirement was to reindex the lucene search.

Overview: When a user placed a cursor and type some keyword ,bydefault it creates a directory lucene_index (absolute path is /path/of/owncloud_installed_dir/data/username/lucene_index ) . On writing the keyword in search box in owncloud, inside lucene_index directory some files will be created.The below given 4 files get created on initial stage and after indexing some more files will be created inside lucene_index directory and some files name will also start with underscore ( _ ).

The below given 4 files will be created when lucene search script start doing indexing.

read.lock.file
segments_1
segments.gen
write.lock.file

After proper indexing some more files will be created(Note: the number of files may vary in case to case scenario.)
Below given is specimen from my Owncloud Server:

root@owncloud-server:/var/www/owncloud/data/sharad# ls -l lucene_index/
total 240
-rwxrwx--- 1 www-data www-data  435 2013-11-14 17:15 _10.cfs
-rwxrwx--- 1 www-data www-data  107 2013-11-14 17:15 _10.sti
-rwxrwx--- 1 www-data www-data  450 2013-11-14 17:15 _11.cfs
-rwxrwx--- 1 www-data www-data  107 2013-11-14 17:15 _11.sti
-rwxrwx--- 1 www-data www-data  511 2013-11-14 17:15 _12.cfs
-rwxrwx--- 1 www-data www-data  107 2013-11-14 17:15 _12.sti
-rwxrwx--- 1 www-data www-data  515 2013-11-14 17:15 _13.cfs
-rwxrwx--- 1 www-data www-data  107 2013-11-14 17:15 _13.sti
-rwxrwx--- 1 www-data www-data  527 2013-11-14 17:15 _14.cfs
-rwxrwx--- 1 www-data www-data  107 2013-11-14 17:15 _14.sti
-rwxrwx--- 1 www-data www-data  528 2013-11-14 17:15 _15.cfs
-rwxrwx--- 1 www-data www-data  107 2013-11-14 17:15 _15.sti
-rwxrwx--- 1 www-data www-data  499 2013-11-14 17:15 _16.cfs
-rwxrwx--- 1 www-data www-data  107 2013-11-14 17:15 _16.sti
-rwxrwx--- 1 www-data www-data  497 2013-11-14 17:15 _17.cfs
-rwxrwx--- 1 www-data www-data 2359 2013-11-14 17:15 _18.cfs
-rwxrwx--- 1 www-data www-data 1773 2013-11-14 17:14 _b.cfs
-rwxrwx--- 1 www-data www-data  107 2013-11-14 17:14 _b.sti
-rwxrwx--- 1 www-data www-data 2046 2013-11-14 17:14 _m.cfs
-rwxrwx--- 1 www-data www-data  107 2013-11-14 17:14 _m.sti
-rwxrwx--- 1 www-data www-data    0 2013-11-14 17:15 optimization.lock.file
-rwxrwx--- 1 www-data www-data    0 2013-11-14 17:15 read.lock.file
-rwxrwx--- 1 www-data www-data    0 2013-11-14 17:15 read-lock-processing.lock.file
-rwxrwx--- 1 www-data www-data  127 2013-11-14 17:15 segments_1d
-rwxrwx--- 1 www-data www-data   20 2013-11-14 17:15 segments.gen
-rwxrwx--- 1 www-data www-data  521 2013-11-14 17:14 _w.cfs
-rwxrwx--- 1 www-data www-data    0 2013-11-14 17:15 write.lock.file
-rwxrwx--- 1 www-data www-data  107 2013-11-14 17:14 _w.sti
-rwxrwx--- 1 www-data www-data 2426 2013-11-14 17:14 _x.cfs
-rwxrwx--- 1 www-data www-data  107 2013-11-14 17:14 _x.sti
-rwxrwx--- 1 www-data www-data  451 2013-11-14 17:14 _y.cfs
-rwxrwx--- 1 www-data www-data  107 2013-11-14 17:15 _y.sti
-rwxrwx--- 1 www-data www-data  419 2013-11-14 17:15 _z.cfs
-rwxrwx--- 1 www-data www-data  107 2013-11-14 17:15 _z.sti

Reindex lucene search in owncloud 5

The given below are details of owncloud server,replace the values as per your server information

MySQL Server Host : localhost (replace with your server FQDN or ip address)
MySQL Database Name : owncloud
MySQL user name : ownclouduser [this is owncloud application’s database user] (or use root)
Table on which we will work : oc_lucene_status and oc_filecache.

Note: Here oc_lucene_status table will play important role.

Step 1: login into your mysql server and give password of MySQL user when it will ask.

mysql -u ownclouduser -h localhost -p 

Step 2: After login into MySQL server, connect to owncloud database

mysql > use owncloud ;

Step 3 : Now clear the oc_lucene_status table. (Reference from Owncloud GitHub)

You can use any one method for clearing the oc_lucene_status table.

(Method 1)

mysql > DELETE FROM oc_lucene_status WHERE 1=1;

OR

(Method 2)

mysql > truncate oc_lucene_status;

Step 4: As I was working in more than 100Gb data in owncloud I faced some issues in lucene indexing and file cacheing. Hence cleared the oc_filecache table as well removed cache and lucene_index directory from username directory.

mysql> truncate oc_filecache;
mysql> exit

In below command,replace the username with your owncloud login user name and also replace the installed owncloud path with /var/www/owncloud

rm -fr /var/www/owncloud/data/username/cache

rm -fr /var/www/owncloud/data/username/lucene_index

Step 5: Now open the web browser and type your owncloud server URL.Login into with your user

http://owncloudserver-ipaddress-or-domain-name

For eg.

http://localhost/owncloud

After login now go to search box and type keyword,you will get loader image rotating,which means indexing has been started. You have to wait and must have patience also.Sometimes it do not show indexing suddenly,in my case I had to wait maximum 15-20 minutes because I has 2-5 GB of data in single user account.

Logout and login back and check once again typing keyword in search box.

Below screenshot is reference:

owncloud-indexing

Share this:

  • Twitter
  • Facebook
  • More
  • Print
  • Email
  • LinkedIn
  • Reddit
  • Tumblr
  • Pinterest
  • Pocket
  • Telegram
  • WhatsApp
  • Mastodon

Related posts:

  1. Search Keyword In Man Page Like We Search In vi / vim Editor
  2. How to install owncloud in Ubuntu 12.10
  3. Installing owncloud in Ubuntu 13.04
  4. How to configure self signed SSL certificate in owncloud Ubuntu
  5. Your data directory and files are probably accessible from the internet because the .htaccess file does not work owncloud
  6. How to install owncloud in Debian Wheezy 7
  7. how to mount NAS storage in owncloud to keep all users data
  8. How to rescan filesystem in owncloud 5
  9. Setup Owncloud 6 with self signed SSL certificate on Ubuntu 13.10
  10. How To Add duckduckgo Search engine in WordPress Blog or website

Filed Under: Linux, owncloud Tagged With: owncloud

Reader Interactions

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Our Social Media Presence

  • Facebook
  • GitHub
  • Twitter

Linux Commands

print working directory ( pwd , PWD , OLDPWD ) in Linux / Unix

Allow only members of Wheel group to use su command on RHEL/CentOS

grep command to remove blank lines from file

rsync over ssh port number on Linux/Unix system

man command not found in CentOS and Red Hat

How to show line numbers with less command in Linux

How to show user account password expiration detail on Linux

Explore 70+ Articles On Linux Commands

Always Useful Tips And Tricks

Nagios HTTP WARNING: HTTP/1.1 403 Forbidden

GNU Screen

Virtual Machine inaccessible status on VirtualBox 4.3

Change the default port number of ssh server

configure: error: C++ compiler cannot create executables

How to backup and restore iptables on Linux systems

Change default editor of crontab in Ubuntu

Explore 90+ Article On "Linux Tips And Tricks"

You Might Like These Articles!

Internal External Command

What is Linux/Unix Internal And External Command

Linux basic command

Linux Basic Commands With Examples For Every Beginner

simplecodesyntax wordpress plugin

SimpleCodeSyntax : My Another WordPress Plugin

Install Nginx

How To Install Nginx On Ubuntu 22.04 LTS

Install Latest Git package in Ubuntu Operating System

How To Always Install Latest Git Package In Ubuntu Operating System

Bash script for installing VirtualBox on Ubuntu 22.04 LTS Desktop

Install VirtualBox On Ubuntu 22.04 LTS Desktop (Bash Script)

Copyright © 2023 ยท
The material in this site cannot be republished either online or offline, without our permission but Schools and Colleges can do in their Private Network
Proudly Blogging From Bharat.

  • Contact
  • About Me
  • My WordPress plugins
  • Privacy Policy