[nodebb-plugin-dbsearch] DB Search Plugin



  • @Ezra-Sharp

    In the ACP, there's an option in the General Settings > General page that says Allow guests to search without logging in. Or is that different from what you are asking?


  • GNU/Linux Admin

    Thanks @planner 🙂 That seems to be what he's asking. Glad we have you around!



  • @julian

    No, no no, I'm not trying to apply for a Community Manager's job, but, but, but...



  • @planner that is what I ask asking, 😛

    But was also suggesting it be enabled on this website. 👍



  • Hi.. im having some "issues" with searching..

    some content isnt showing on the search result.. .. like.. i got a thread with a word that repeats on the content.. but i look for that word.. and i dont get that thread as result... 😞

    any thoughts?

    agiletesters .com .br -> search for 'cucumber'


  • GNU/Linux Admin

    @Leonardo-Galani Does it work if you go to the plugin admin page and click "ReIndex"?



  • @baris

    When do I have to reindex? After every install / udpate?


  • Staff Admin

    You don't have to reindex after upgrades or new installs.



  • @baris Hey buddy, I'm unable to re-index my data, there's a lot of it, and it basically brings the server to a standstill, nodebb crashes and nothing appears indexed after a restart. 500 error teaser doesn't exist.

    Stats:

    28,000 posts
    2000 topics from 490 users.

    While it's indexing I get a 504 Gateway Time-out. Is there a way to break up the indexing?

    Just had a thought, it says new content is indexed automatically, if I re-index before I import my data, would that work?


  • Staff Admin

    Can you update the plugin and nodebb core and give it another try? I reindex 1.6k
    topics and 12.5k posts in 30 seconds. I added some logging and timing into reindex so you should see the progress now. Also changed the reindex to use eachLimit so it doesn't try to reindex everything at once.

    Let me know if it changes anything.



  • @baris Thanks, will give it a go and let you know. 👍


  • Global Moderator

    @baris What versions have compatibility with 0.5.x?


  • Staff Admin

    0.0.15 should be compatible with 0.5.x



  • Tried this out (is it the only search plugin?!) for v0.6.x and searches have an issue with broken templates I think?
    dbsearch.JPG
    You get no search results, and a broken page (as above)
    As well as a console error in JS of "Uncaught TypeError: Cannot read property 'split' of undefined" but that's probably more a symptom of the template render issue.


  • GNU/Linux Admin

    @Drew-Llewellyn we also support solr and elasticsearch 😄

    ... but for those you have to have some and elasticsearch installed, respectively.



  • @julian Is that instead of redis, or as well as?
    Also, any clue what's up with the search page? Or where I'd find the template file for that fragment to begin looking into it myself?



  • @Drew-Llewellyn said:

    Tried this out (is it the only search plugin?!) for v0.6.x and searches have an issue with broken templates I think?
    dbsearch.JPG
    You get no search results, and a broken page (as above)
    As well as a console error in JS of "Uncaught TypeError: Cannot read property 'split' of undefined" but that's probably more a symptom of the template render issue.

    This is my compiled search.tpl file, and I can't seem to find what the problem is:

    <ol class="breadcrumb">
    	<!-- BEGIN breadcrumbs -->
    	<li itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb" <!-- IF @last -->class="active"<!-- ENDIF @last -->>
    		<!-- IF !@last --><a href="{breadcrumbs.url}" itemprop="url"><!-- ENDIF !@last -->
    			<span itemprop="title">
    				{breadcrumbs.text}
    				<!-- IF @last -->
    				<!-- IF !feeds:disableRSS -->
    				<!-- IF rssFeedUrl --><a target="_blank" href="{rssFeedUrl}"><i class="fa fa-rss-square"></i></a><!-- ENDIF rssFeedUrl --><!-- ENDIF !feeds:disableRSS -->
    				<!-- ENDIF @last -->
    			</span>
    		<!-- IF !@last --></a><!-- ENDIF !@last -->
    	</li>
    	<!-- END breadcrumbs -->
    </ol>
    
    <div class="search">
    	<div class="row">
    
    		<div class="well col-md-12">
    			<form id="advanced-search">
    				<div class="form-group">
    					<label>[[global:search]]</label>
    					<input type="text" class="form-control" id="search-input" placeholder="[[global:search]]">
    				</div>
    				<div class="form-group">
    					<label>[[search:in]]</label>
    					<select class="form-control">
    						<option value="posts">[[global:posts]]</option>
    						<option value="users">[[global:users]]</option>
    						<option value="tags">[[tags:tags]]</option>
    					</select>
    				</div>
    				<div class="form-group by-container<!-- IF hidePostedBy --> hide<!-- ENDIF hidePostedBy -->">
    					<label>[[search:by]]</label>
    					<input type="text" class="form-control" id="posted-by-input" placeholder="[[search:posted-by]]">
    				</div>
    				<button type="submit" class="btn btn-default">[[global:search]]</button>
    			</form>
    		</div>
    
    		<div id="results" class="col-md-12" data-search-query="{search_query}">
    			<!-- IF matchCount -->
    			<div class="alert alert-info">[[search:results_matching, {matchCount}, {search_query}, {time}]] </div>
    			<!-- ELSE -->
    			<div class="alert alert-warning">[[search:no-matches]]</div>
    			<!-- ENDIF matchCount -->
    
    			<!-- BEGIN posts -->
    			<div class="topic-row panel panel-default clearfix">
    				<div class="panel-body">
    
    					<a href="{relative_path}/topic/{posts.topic.slug}/{posts.index}" class="search-result-text">
    						<h4>{posts.topic.title}</h4>
    					</a>
    					<div class="search-result-text">
    						{posts.content}
    						<p class="fade-out"></p>
    					</div>
    
    					<small>
    						<span class="pull-right footer">
    							<a href="{relative_path}/users/{posts.user.userslug}"><img class="user-img" title="{posts.user.username}" src="{posts.user.picture}"/></a>
    							[[global:posted_in_ago, <a href="{relative_path}/category/{posts.category.slug}"><i class="fa {posts.category.icon}"></i> {posts.category.name}</a>, <span class="timeago" title="{posts.relativeTime}"></span>]]
    						</span>
    					</small>
    				</div>
    			</div>
    			<!-- END posts -->
    
    			<!-- IF users.length -->
    			<ul id="users-container" class="users-container">
    <!-- BEGIN users -->
    <li class="users-box registered-user" data-uid="{users.uid}">
    	<a href="{relative_path}/user/{users.userslug}"><img src="{users.picture}" class="img-thumbnail"/></a>
    	<br/>
    	<div class="user-info">
    		<span>
    			<i class="fa fa-circle status {users.status}" title="[[global:{users.status}]]"></i>
    			<a href="{relative_path}/user/{users.userslug}">{users.username}</a>
    		</span>
    		<br/>
    		<div title="reputation" class="reputation">
    			<i class='fa fa-star'></i>
    			<span class='formatted-number'>{users.reputation}</span>
    		</div>
    		<div title="post count" class="post-count">
    			<i class='fa fa-pencil'></i>
    			<span class='formatted-number'>{users.postcount}</span>
    		</div>
    	</div>
    </li>
    <!-- END users -->
    			</ul>
    			<!-- ENDIF users.length -->
    
    			<!-- IF tags.length -->
    <!-- BEGIN tags -->
    <h3 class="pull-left tag-container">
    	<a href="{relative_path}/tags/{tags.value}" data-value="{tags.value}"><span class="tag-item" data-tag="{tags.value}" style="<!-- IF tags.color -->color: {tags.color};<!-- ENDIF tags.color --><!-- IF tags.bgColor -->background-color: {tags.bgColor};<!-- ENDIF tags.bgColor -->">{tags.value}</span><span class="tag-topic-count">{tags.score}</span></a>
    </h3>
    <!-- END tags -->
    			<!-- ENDIF tags.length -->
    		</div>
    	</div>
    </div>


  • @Drew-Llewellyn What version of templates.js are you using? It's in your node_modules folder. Also make sure vanilla and lavender are up to date.



  • @a_5mith
    templates.js 0.1.9
    nodebb-theme-vanilla 0.2.30
    nodebb-theme-lavender 0.2.13



  • Fixed by an npm install in nodebb root folder. Must've got the wrong version of something somewhere.


Log in to reply
 

Suggested Topics

| |