THIS IS ARCHIVED DOCUMENTATION

LINQ QueryResults Example: Introduction

Coveo for Sitecore (July 2016) Coveo for Sitecore 4.1 (November 2018)

This page is a tutorial showing you how to use a LINQ-based search page.

It’s not recommended to create a complete page based only on LINQ. You should instead use the built-in Sitecore implementation using Javascript-driven search.

Introduction

This tutorial shows you how to create a search page and add many components using only LINQ expressions for queries. It’s structured with modularity in mind allowing you to add all the components that you need on your search page.

It’s not recommended to create a full search page driven by LINQ (see Warnings).

You should start with Create a Basic Search Page, as it’s used as the basis for each component example. Also, feel free to style, add or remove properties, and customize each page to your liking, as the examples given in this tutorial aren’t personalized in any way.

Warnings

  • It’s not possible to log analytics using only LINQ.

  • Each component needs a custom implementation.

  • No automatic URL query parameters are handled.

  • There’s no direct mapping between the controls and the query to execute.

  • It’s not recommended to create a complete page based only on LINQ. You should instead use the built-in Sitecore implementation using Javascript-driven search.

  • It doesn’t cover all corner cases. You should handle those cases according to your own implementation.

  • This tutorial is for learning purposes, and lacks reliability and functionalities to be used in a production environment.

Prerequisites

To follow this tutorial, you’ll need:

  • Any supported Sitecore instance (See Supported Sitecore Versions and Dependencies for more details)

  • A Coveo for Sitecore July 2016 or later release

  • Items already indexed, so that you can get results while testing

  • Basic knowledge of IIS and ASP.Net, specifically:

    • Page_Load event

    • PostBack handling

    • Control binding between client and server

Terminology Used

Client-Side Code

The .aspx file, containing the code and tags to be executed in the browser.

Server-Side Code

The .aspx.cs file, containing the code to be executed on the server.

What’s Next?

You may proceed to the first step of this tutorial: Create a Basic Search Page.