#StackBounty: #custom-taxonomy #search WordPress Search – display taxonomy terms in results

Bounty: 50

I have a custom post type of Hotel. Hotels can be can be categorised with the taxonomy Resort.

On my search page I need to be able to list hotels and taxonomy terms in the results, as separate results. eg:

Resort Name
Hotel Name
Hotel Name
Hotel Name

Resorts should come first, followed by hotels and anything else. As far as I know taxonomy terms are not shown by default in WordPress search.

In my functions.php I’m currently limiting the search to specific post types:

function filter_search($query) {
// Don't run in admin area
if(!is_admin()) {
    // Limit search to posts
    if($query->is_main_query() && $query->is_search()) {
        $query->set('post_type', array('hotel', 'post', 'activities', 'page'));
    }

    // Return query
    return $query;
  }
}

add_filter('pre_get_posts', 'filter_search');

Then in my search.php I am grouping the results by post type:

<?php $types = array('hotel', 'post', 'activities', 'page');
foreach( $types as $type ){

echo '
'; ?>

Hotel: Activity: Blog Post: Page: Page: ">

" class="button">View Page

</div> <?php } } rewind_posts(); echo '</div> '; } ?>

What I’m struggling with is how to tell WordPress to show the taxonomy term (Resort) in the results as it’s own result. Can anybody help?


Get this bounty!!!

#StackBounty: #2010 #search #document-id No documents with the ID xxx were found in this site collection

Bounty: 50

I have the following situation on our SharePoint 2010 environment.
Sometimes it happens, that a document id link of a document in a library does not work anymore.
When you click on the link it says this error:

Operation Completed Successfully

No documents with the ID PRODUCTS-xxx-xxx were found in this site
collection.

enter image description here

The document is not being changed and even when an incremental or full crawl ran, the document id link is still not working.

This is happening in one specific document library of a site collection. Other document libraries in the site collection does not have this issue.

I already tried the solutions in this post, but these did not help either.

SP2010 – After upload Doc ID is assigned, but using the Doc ID link results in No documents with the ID where found in this site collection

Any ideas why this happens and what I can do in this situation to make the link work again?


Get this bounty!!!

#StackBounty: #google-search #search #google-groups #keyword #usenet How to search Google Groups for keywords

Bounty: 100

I went to https://groups.google.com and searched for boot ring seat, looking for a specific Usenet message that I know has those three words in it. No results. All right, I thought, maybe I’m misremembering the Usenet message. So I searched instead for whenever — there must be some Usenet messages with that word in it! But still no results. (It says “Posts: 0, groups: 1354”.) (These searches were done when not logged in to Google.)

What am I doing wrong? How do I search for Usenet posts by keywords in them?


Some notes (that you can skip) about research I already did toward answering this question:

There is a help link on that search-result page, but there’s nothing about searching listed there. The most promising subtopic is “Learn how to read and create posts”, which doesn’t actually answer this question.

I also did a Google Web search on searching google groups usenet, but the top few results were unhelpful. The top one is from 2010, so I skipped it as likely OBE; the next promising one is this SU post, which is about browsing a newsgroup rather than searching by keyword; etc.


Get this bounty!!!

#StackBounty: #8 #search Filter by tags in search api views?

Bounty: 50

I’m working to create a search API view. I have on exposed filter that’s “fulltext search”. I’d like to expose another filter that works similar to the core exposed entity reference, in that my users can reference multiple tags, seperated by commas, and the field will autocomplete the results for each item.

Is there a way to do this using the search api views module and the search api autocomplete module? AFAICT there’s not a way to autocomplete multiple words/phrases, instead of just the first word/phrase.


Get this bounty!!!

#StackBounty: #python #search #grid #knn #imputation grid search with own estimator in python

Bounty: 50

I am trying to build my own estimator (regressor) and use it for imputation (KnnImputation).
For now – I wrote a very basic knn imputation, when it will work I will change the algorithm a bit.

I’m having a problem using the grid search “GridSearchCV”.
I tried to print the shapes of the data to get a sense of the problem. When the configuration is 10-fold cross validation I would expect the prints to be 10 times this lines:

xTrain size : 2487
yTrain size : 2487
test size : 276

But instead I get this lines:

xTrain size : 2487
yTrain size : 2487
test size : 276

test size : 2487

more the 60 times.

Any idea what is the problem?

My Code:

class KnnImputation(BaseEstimator, RegressorMixin):

    def __init__(self, k=5, distance='euclidean'):
        self.k = k
        self.distance = distance

    def get_params(self, deep=False):
        return {'k': self.k, 'distance': self.distance}

    def set_params(self, **parameters):
        self.k = parameters['k']
        self.distance = parameters['distance']

    def fit(self, X, y):
        self.xTrain = X.values
        self.yTrain = y.values
        print("nxTrain size : " + str(self.xTrain.shape[0]))
        print("yTrain size : " + str(self.yTrain.shape[0]))

        return self

    def predict(self, xTest):
        xTest = xTest.values
        num_test = xTest.shape[0]
        print("test size : " + str(num_test)+"n")
        yPred = np.zeros(num_test, dtype=self.yTrain.dtype).reshape(-1, 1)

        for i in range(num_test):
            distances = np.sum(np.abs(self.xTrain - xTest[i, :]), axis=1)
            idx = np.argsort(distances)
            minIndexes = idx[:self.k]
            kClosest = self.yTrain[minIndexes[:]]
            yPred[i] = np.mean(kClosest)

        return yPred

kf = KFold(n_splits=10, shuffle=False, random_state=23)
NN = KnnImputation()
gridSearchNN = GridSearchCV(NN, param_grid=params, scoring="neg_mean_squared_error", n_jobs=1,
                                cv=kf.split(xTrain, yTrain), verbose=1)
gridSearchNN.fit(X=xTrain, y=yTrain)

The Error:

  File "C:Users....dataImputation.py", line 85, in knnImputationMethod
    gridSearchNN.fit(X=xTrain, y=yTrain)
  File "C:Users...Anaconda3libsite-packagessklearnmodel_selection_search.py", line 740, in fit
    self.best_estimator_.fit(X, y, **fit_params)
AttributeError: 'NoneType' object has no attribute 'fit'


Get this bounty!!!

#StackBounty: #search #search-results #spfx #search-schema Fetching modern sharepoint page comments and likes count using search api

Bounty: 50

I can’t seem to find the correct managed property for both modern Comments Count & Likes Count at all as all managed property within schema returned 0 counts.
enter image description here

enter image description here

I would like to avoid additional query again just to get each items likes/comments count when querying news posts using search api.

https://pnp.github.io/pnpjs/sp/docs/comments-likes/


Get this bounty!!!

#StackBounty: #8 #search How to place facet block in views page header? (not regions)

Bounty: 50

I’ve created a search with Search API module and Facets module. I’ve added two taxonomy term name fields to my search index and created two facets for those fields. Just for testing I’ve placed the facet blocks in my main content area, and fulltext search and faceted filtering are working as expected.

Now I want to place the facet blocks in the header of the view, and not in a page region. I’ve checked the block source file and ID of the facet blocks is facet_block. Facet blocks are derived blocks, so my best guess was that the block ID should be facet_block:MACHINE_NAME_OF_FACET.

I’ve added a Global: Rendered entity - Block to the header of the view. As block ID I’ve entered the schema from above, e.g. facet_block:museum for my “museum” facet.

However, the facet block doesn’t show in the views header. (The same facets placed via block layout still work fine.)

Can anybody tell me how to render facet blocks inside a view header?

(I’m looking for a no-code-solution, without preprocessing or editing templates)


Get this bounty!!!

#StackBounty: #php #wp-query #query #search #tax-query How to create a WP_Query to search the Title or Tag?

Bounty: 50

I have created a search using WP_Query, it seems like this query is looking for the queried term in title AND tags.

Is there a way to have this search the title OR tags?

$s = $request['s'];
$tags = str_replace(' ', '-', strtolower($request['s']));

$paged = $request['page'];
$posts_per_page = $request['per_page'];

$result = new WP_Query([
    'post_type'         => 'post',
    'category__in'      => 3060,
    'posts_per_page'    => $posts_per_page,
    'paged'             => $page,
    'orderby'           => 'date',
    'order'             => 'desc',
    's'                 => $s,
    'tag'               => array($tags)
]);


Get this bounty!!!

#StackBounty: #windows #windows-10 #search Can't find .lnk shortcuts Windows 10

Bounty: 100

I have many .lnk shortcuts that I use on a daily basis, including multiple different users on Chrome and start locations for CMD. When I search their names on windows search (win+s), the shortcuts show up, but when I use any third party search applications (such as Cerebro, Wox, etc.), I can’t find them. Why is this?

It’s worth noting that I have only had this problem after switching to a new windows 10 laptop, on my old one .lnk files worked fine with Cerebro and Wox.


Get this bounty!!!

#StackBounty: #windows #windows-10 #search Can't find .lnk shortcuts Windows 10

Bounty: 100

I have many .lnk shortcuts that I use on a daily basis, including multiple different users on Chrome and start locations for CMD. When I search their names on windows search (win+s), the shortcuts show up, but when I use any third party search applications (such as Cerebro, Wox, etc.), I can’t find them. Why is this?

It’s worth noting that I have only had this problem after switching to a new windows 10 laptop, on my old one .lnk files worked fine with Cerebro and Wox.


Get this bounty!!!